projectlens 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -313,7 +313,7 @@ export function verifyToken(token: string, email: string) {
313
313
  }
314
314
  `};function oH(e){return{source:"lint",severity:e.severity,title:e.message,filePath:e.filePath,line:e.line,column:e.column,endLine:e.endLine,ruleId:e.ruleId,fixable:e.fixable,description:e.message,snippet:e.snippet}}function oG(e){return{source:"types",severity:"error",title:e.message,filePath:e.filePath,line:e.line,column:e.column,code:e.code,description:e.message,related:e.related}}function oK(e){return{source:"security",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line,endLine:e.endLine,category:e.category,confidence:e.confidence,description:e.description,recommendation:e.recommendation,suggestedFix:e.suggestedFix,snippet:e.snippet,reference:e.reference}}function oJ(e){return{source:"deps",severity:e.severity,title:e.title,filePath:"package.json",line:1,category:e.kind,description:e.detail,recommendation:e.recommendation,reference:e.reference,cves:e.cves,dep:{name:e.name,current:e.current,latest:e.latest,fixedIn:e.fixedIn,type:e.type,kind:e.kind,license:e.license,usedIn:e.usedIn}}}let oY={ok:"Configured correctly",missing:"Referenced but never defined",undocumented:"Missing from .env.example",unused:"Defined but never used",exposed:"Secret reachable from the client bundle",empty:"Defined with an empty value"};function oX(e){return{source:"env",severity:e.severity,title:`${e.key} — ${oY[e.status]??e.status}`,filePath:e.usedIn[0]??e.definedIn[0]??".env.local",line:1,category:e.status,description:e.note,recommendation:"exposed"===e.status?"Move this read into a Server Component, Route Handler, or Server Action. Never reference a non-NEXT_PUBLIC secret from client code.":"missing"===e.status?"Add the variable to .env.local (and .env.example) before it is read at runtime.":"undocumented"===e.status?"Add the key with a placeholder value and a comment to .env.example.":"unused"===e.status?"Remove the unused variable to reduce confusion and attack surface.":"empty"===e.status?"Provide a real value or guard the code path that reads it.":void 0,env:{key:e.key,scope:e.scope,status:e.status,usedIn:e.usedIn,definedIn:e.definedIn,sample:e.sample}}}function oQ(e){let t=[...e.issues].sort((e,t)=>o3(t.severity)-o3(e.severity))[0];return{source:"network",severity:t?.severity??"info",title:t?t.message:`${e.method} ${e.host}`,filePath:e.filePath,line:e.line,category:e.client,description:`${e.method} request to ${e.url} via ${e.client}.`+(e.issues.length?` ${e.issues.length} issue${1===e.issues.length?"":"s"} detected.`:" No issues detected."),recommendation:e.issues.map(e=>e.message).join(" "),net:{url:e.url,host:e.host,method:e.method,client:e.client,secure:e.secure,external:e.external,issues:e.issues}}}function o0(e){return{source:"database",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line??1,category:e.kind,description:e.detail,recommendation:e.recommendation,snippet:e.snippet,db:{engine:e.engine,kind:e.kind,target:e.target}}}function o1(e){return{source:"git",severity:e.severity,title:e.title,filePath:e.filePath??".git",line:1,category:e.kind,description:e.detail,recommendation:e.recommendation}}let o2={critical:"critical",serious:"high",moderate:"medium",minor:"low"};function o4(e){return{source:"a11y",severity:o2[e.impact]??"medium",title:e.help,filePath:e.filePath,line:e.line,category:e.rule,description:`${e.description}. ${e.nodes} ${1===e.nodes?"element is":"elements are"} affected (${e.selector}).`,recommendation:e.recommendation,snippet:e.snippet,a11y:{rule:e.rule,impact:e.impact,principle:e.principle,wcag:e.wcag,helpUrl:e.helpUrl,selector:e.selector,nodes:e.nodes}}}function o5(e){return{source:"perf",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line??1,category:e.kind,description:e.detail,recommendation:e.recommendation,snippet:e.snippet,perf:{kind:e.kind,estimatedSavingKb:e.estimatedSavingKb}}}function o6(e){return{source:"tests",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line??1,category:e.kind,description:e.detail,recommendation:e.recommendation,snippet:e.snippet,test:{kind:e.kind}}}function o3(e){return({critical:6,error:5,high:4,warning:3,medium:3,low:2,info:1})[e]??1}let o9={injection:[{label:"OWASP: SQL Injection Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html",kind:"OWASP"},{label:"PortSwigger: SQL injection",href:"https://portswigger.net/web-security/sql-injection",kind:"PortSwigger"}],xss:[{label:"OWASP: XSS Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html",kind:"OWASP"},{label:"React: dangerouslySetInnerHTML",href:"https://react.dev/reference/react-dom/components/common#dangerously-setting-the-inner-html",kind:"React"}],auth:[{label:"OWASP: Authorization Cheat Sheet",href:"https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html",kind:"OWASP"},{label:"OWASP: Broken Access Control",href:"https://owasp.org/Top10/A01_2021-Broken_Access_Control/",kind:"OWASP"}],secrets:[{label:"OWASP: Secrets Management",href:"https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html",kind:"OWASP"},{label:"Next.js: Environment Variables",href:"https://nextjs.org/docs/app/building-your-application/configuring/environment-variables",kind:"Next.js"}],crypto:[{label:"OWASP: Cryptographic Storage",href:"https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html",kind:"OWASP"},{label:"Node.js: crypto.randomBytes",href:"https://nodejs.org/api/crypto.html#cryptorandombytessize-callback",kind:"Node.js"}],ssrf:[{label:"OWASP: SSRF Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html",kind:"OWASP"}],config:[{label:"OWASP: Security Misconfiguration",href:"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/",kind:"OWASP"}],"data-exposure":[{label:"OWASP: Sensitive Data Exposure",href:"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure",kind:"OWASP"}],other:[{label:"OWASP Top 10",href:"https://owasp.org/www-project-top-ten/",kind:"OWASP"}]};function o8(e){let t=[];if("lint"===e.source&&e.ruleId){var n;let r=(n=e.ruleId).startsWith("@typescript-eslint/")?{label:`typescript-eslint: ${n}`,href:`https://typescript-eslint.io/rules/${n.replace("@typescript-eslint/","")}/`,kind:"typescript-eslint"}:n.startsWith("react-hooks/")?{label:"React: Rules of Hooks",href:"https://react.dev/reference/rules/rules-of-hooks",kind:"React"}:n.startsWith("jsx-a11y/")?{label:`eslint-plugin-jsx-a11y: ${n}`,href:`https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/${n.replace("jsx-a11y/","")}.md`,kind:"a11y"}:n.startsWith("import/")?{label:`eslint-plugin-import: ${n}`,href:`https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/${n.replace("import/","")}.md`,kind:"import"}:{label:`ESLint: ${n}`,href:`https://eslint.org/docs/latest/rules/${n}`,kind:"ESLint"};t.push(r)}for(let n of("types"===e.source&&e.code&&t.push({label:`Explained: ${e.code}`,href:`https://typescript.tv/errors/#${e.code}`,kind:"typescript.tv"},{label:"TypeScript Handbook",href:"https://www.typescriptlang.org/docs/handbook/2/everyday-types.html",kind:"TypeScript"}),"security"===e.source&&(e.reference?.startsWith("CWE-")&&t.push({label:e.reference,href:`https://cwe.mitre.org/data/definitions/${e.reference.replace("CWE-","")}.html`,kind:"MITRE CWE"}),e.category&&o9[e.category]&&t.push(...o9[e.category])),e.cves??[]))t.push({label:n,href:`https://nvd.nist.gov/vuln/detail/${n}`,kind:"NVD"});if("deps"===e.source&&e.dep){let{name:n}=e.dep,r=encodeURIComponent(n);e.reference&&t.push({label:"Primary advisory",href:e.reference,kind:"Advisory"}),t.push({label:`npm: ${n}`,href:`https://www.npmjs.com/package/${r}`,kind:"npm"},{label:"Snyk vulnerability DB",href:`https://security.snyk.io/package/npm/${r}`,kind:"Snyk"},{label:"GitHub Advisories",href:`https://github.com/advisories?query=${r}`,kind:"GitHub"},{label:"Socket.dev supply-chain report",href:`https://socket.dev/npm/package/${r}`,kind:"Socket"},{label:"deps.dev dependency graph",href:`https://deps.dev/npm/${r}`,kind:"deps.dev"}),"license"===e.dep.kind&&t.push({label:"SPDX license list",href:"https://spdx.org/licenses/",kind:"SPDX"})}if("env"===e.source&&(t.push({label:"Next.js: Environment Variables",href:"https://nextjs.org/docs/app/building-your-application/configuring/environment-variables",kind:"Next.js"},{label:"OWASP: Secrets Management",href:"https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html",kind:"OWASP"}),e.env?.status==="exposed"&&t.push({label:"Next.js: Keeping Server-Only Code",href:"https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#keeping-server-only-code-out-of-the-client-environment",kind:"Next.js"})),"network"===e.source&&(t.push({label:"MDN: Using the Fetch API",href:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",kind:"MDN"},{label:"MDN: AbortController (timeouts)",href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortController",kind:"MDN"}),e.net&&!e.net.secure&&t.push({label:"MDN: Mixed content",href:"https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content",kind:"MDN"})),"database"===e.source){let n=e.db?.engine;"mongodb"===n?t.push({label:"MongoDB: Indexing Strategies",href:"https://www.mongodb.com/docs/manual/applications/indexes/",kind:"MongoDB"},{label:"MongoDB: Query Optimization",href:"https://www.mongodb.com/docs/manual/core/query-optimization/",kind:"MongoDB"},{label:"Mongoose: Connections",href:"https://mongoosejs.com/docs/connections.html",kind:"Mongoose"}):"redis"===n?t.push({label:"Redis: Key expiration (TTL)",href:"https://redis.io/docs/latest/develop/use/keyspace/#key-expiration",kind:"Redis"},{label:"Redis: TLS support",href:"https://redis.io/docs/latest/operate/oss_and_stack/management/security/encryption/",kind:"Redis"}):t.push({label:"PostgreSQL: Using EXPLAIN",href:"https://www.postgresql.org/docs/current/using-explain.html",kind:"PostgreSQL"},{label:"PostgreSQL: Indexes",href:"https://www.postgresql.org/docs/current/indexes.html",kind:"PostgreSQL"}),e.db?.kind==="injection"&&t.push({label:"OWASP: SQL Injection Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html",kind:"OWASP"}),e.db?.kind==="n+1"&&t.push({label:"The N+1 query problem",href:"https://planetscale.com/blog/what-is-n-1-query-problem-and-how-to-solve-it",kind:"PlanetScale"})}if("git"===e.source&&(t.push({label:"GitHub: Removing sensitive data",href:"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository",kind:"GitHub"},{label:"GitHub Actions: Security hardening",href:"https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions",kind:"GitHub"}),"large-file"===e.category&&t.push({label:"Git LFS",href:"https://git-lfs.com/",kind:"Git LFS"})),"a11y"===e.source&&e.a11y){t.push({label:`axe: ${e.a11y.rule}`,href:e.a11y.helpUrl,kind:"Deque"},{label:"WAI-ARIA Authoring Practices",href:"https://www.w3.org/WAI/ARIA/apg/",kind:"W3C"},{label:"MDN: Accessibility",href:"https://developer.mozilla.org/en-US/docs/Web/Accessibility",kind:"MDN"});let n=e.a11y.wcag.find(e=>/^\d/.test(e));n&&t.push({label:`WCAG ${n}`,href:`https://www.w3.org/WAI/WCAG21/Understanding/${n.replace(/\./g,"")}`,kind:"WCAG"})}return"perf"===e.source&&(t.push({label:"web.dev: Core Web Vitals",href:"https://web.dev/articles/vitals",kind:"web.dev"},{label:"Next.js: Optimizing",href:"https://nextjs.org/docs/app/building-your-application/optimizing",kind:"Next.js"}),e.perf?.kind==="unoptimized-image"&&t.push({label:"next/image",href:"https://nextjs.org/docs/app/api-reference/components/image",kind:"Next.js"}),(e.perf?.kind==="large-dependency"||e.perf?.kind==="duplicate-dependency")&&t.push({label:"Bundlephobia",href:"https://bundlephobia.com/",kind:"Bundlephobia"}),e.perf?.kind==="layout-shift"&&t.push({label:"web.dev: Optimize CLS",href:"https://web.dev/articles/optimize-cls",kind:"web.dev"}),(e.perf?.kind==="render-blocking"||e.perf?.kind==="sync-script")&&t.push({label:"next/script",href:"https://nextjs.org/docs/app/api-reference/components/script",kind:"Next.js"}),(e.perf?.kind==="no-code-split"||e.perf?.kind==="no-memo")&&t.push({label:"React: lazy & Suspense",href:"https://react.dev/reference/react/lazy",kind:"React"})),"tests"===e.source&&(t.push({label:"Vitest docs",href:"https://vitest.dev/guide/",kind:"Vitest"},{label:"Testing Library queries",href:"https://testing-library.com/docs/queries/about/",kind:"Testing Library"}),e.test?.kind==="flaky"&&t.push({label:"Vitest: async & timers",href:"https://vitest.dev/guide/mocking.html#timers",kind:"Vitest"}),(e.test?.kind==="uncovered"||e.test?.kind==="no-tests")&&t.push({label:"Vitest: coverage",href:"https://vitest.dev/guide/coverage.html",kind:"Vitest"})),t}let o7=[{id:"vscode",label:"VS Code",url:(e,t,n)=>`vscode://file/${e}:${t}:${n}`},{id:"cursor",label:"Cursor",url:(e,t,n)=>`cursor://file/${e}:${t}:${n}`},{id:"windsurf",label:"Windsurf",url:(e,t,n)=>`windsurf://file/${e}:${t}:${n}`},{id:"vscode-insiders",label:"VS Code Insiders",url:(e,t,n)=>`vscode-insiders://file/${e}:${t}:${n}`},{id:"webstorm",label:"WebStorm",url:(e,t)=>`webstorm://open?file=${encodeURIComponent(e)}&line=${t}`},{id:"zed",label:"Zed",url:(e,t,n)=>`zed://file/${e}:${t}:${n}`}];function le(e,t){return t.startsWith("/")?t:`${e.replace(/\/$/,"")}/${t}`}let lt=[{id:"todo",name:"To do"},{id:"in-progress",name:"In progress"},{id:"done",name:"Done",done:!0}],ln=[{id:"g_backlog",name:"Backlog",createdAt:"1970-01-01T00:00:00.000Z"},{id:"g_sprint",name:"This sprint",createdAt:"1970-01-01T00:00:00.000Z"}],lr="projectlens.tasks.v2",li="projectlens.tasks.v1",la="projectlens.task-columns.v1",ls="projectlens.task-groups.v1",lo="projectlens:tasks-changed";function ll(e="t"){return`${e}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function ld(){try{let e=window.localStorage.getItem(la);if(!e)return lt;let t=JSON.parse(e);return Array.isArray(t)&&t.length>0?t:lt}catch{return lt}}function lc(e){window.localStorage.setItem(la,JSON.stringify(e)),window.dispatchEvent(new CustomEvent(lo))}function lu(){let[e,t]=(0,eP.useState)([]),n=(0,eP.useCallback)(()=>t(ld()),[]);return(0,eP.useEffect)(()=>{n();let e=()=>n();return window.addEventListener(lo,e),window.addEventListener("storage",e),()=>{window.removeEventListener(lo,e),window.removeEventListener("storage",e)}},[n]),e}function lm(){try{let e=window.localStorage.getItem(lr);if(!e)return function(){try{let e=window.localStorage.getItem(li);if(!e)return null;let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(({status:e,...t})=>({...t,columnId:e}));return window.localStorage.setItem(lr,JSON.stringify(n)),window.localStorage.removeItem(li),n}catch{return null}}()??[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function lp(e){window.localStorage.setItem(lr,JSON.stringify(e)),window.dispatchEvent(new CustomEvent(lo))}function lf(e){let t=new Date().toISOString(),n={id:ll(),title:e.title,columnId:e.columnId??ld()[0]?.id??"todo",priority:e.priority??"medium",source:e.source,severity:e.severity,filePath:e.filePath,line:e.line,groupId:e.groupId,note:e.note,issue:e.issue,createdAt:t,updatedAt:t};return lp([n,...lm()]),n}function lh(e){return`${e.source}::${e.filePath}::${e.line}::${e.title}`}function lg(e){return e.source?`${e.source}::${e.filePath}::${e.line}::${e.title}`:null}function lx(e,t){lp(lm().map(n=>n.id===e?{...n,...t,updatedAt:new Date().toISOString()}:n))}function lv(e,t,n){let r,i=lm(),a=i.find(t=>t.id===e);if(!a)return;let s={...a,columnId:t,updatedAt:new Date().toISOString()},o=i.filter(t=>t.id!==e);if(n&&n!==e){let e=o.findIndex(e=>e.id===n);r=-1===e?o.length:e}else{let e=-1;o.forEach((n,r)=>{n.columnId===t&&(e=r)}),r=-1===e?o.length:e+1}o.splice(r,0,s),lp(o)}function ly(e){lp(lm().filter(t=>t.id!==e))}function lb(){let e=new Set(ld().filter(e=>e.done).map(e=>e.id));lp(lm().filter(t=>!e.has(t.columnId)))}function lk(){try{let e=window.localStorage.getItem(ls);if(!e)return ln;let t=JSON.parse(e);return Array.isArray(t)?t:ln}catch{return ln}}function lj(e){window.localStorage.setItem(ls,JSON.stringify(e)),window.dispatchEvent(new CustomEvent(lo))}function lw(e){let t={id:ll("g"),name:e.trim(),createdAt:new Date().toISOString()};return lj([...lk(),t]),t}function lN(e){let[t,n]=(0,eP.useState)(e),r=(0,eP.useCallback)(()=>n(e()),[e]);return(0,eP.useEffect)(()=>{r();let e=()=>r();return window.addEventListener(lo,e),window.addEventListener("storage",e),()=>{window.removeEventListener(lo,e),window.removeEventListener("storage",e)}},[]),t}function l_(){let e=lN(lm),t=new Set;for(let n of e){let e=lg(n);e&&t.add(e)}return t}let lS=(0,eP.createContext)(null);function l$(){let e=(0,eP.useContext)(lS);if(!e)throw Error("useInspector must be used within <InspectorProvider>");return e}function lI({absPath:e,line:t,column:n}){return(0,eT.jsxs)(a5,{children:[(0,eT.jsxs)(a6,{className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oP,{className:"size-3.5"}),"Open in IDE"]}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-44",children:[(0,eT.jsxs)(a9,{className:"font-mono text-[10px] uppercase tracking-wider",children:["Open at ",t,":",n]}),(0,eT.jsx)(a7,{}),o7.map(r=>(0,eT.jsx)(a8,{render:(0,eT.jsxs)("a",{href:r.url(e,t,n),children:[(0,eT.jsx)(si,{className:"size-3.5"}),r.label]})},r.id))]})]})}function lE({code:e,highlight:t}){let n=e.replace(/\n$/,"").split("\n"),r=(0,eP.useRef)(null);return(0,eT.jsx)("pre",{className:"overflow-x-auto py-2 font-mono text-xs leading-relaxed",children:(0,eT.jsx)("code",{className:"block",children:n.map((e,n)=>{let i=n+1,a=i===t;return(0,eT.jsxs)("div",{ref:a?e=>{r.current=e,e?.scrollIntoView({block:"center"})}:void 0,className:(0,ny.cn)("flex",a&&"bg-foreground/[0.08]"),children:[(0,eT.jsx)("span",{className:(0,ny.cn)("sticky left-0 w-12 shrink-0 select-none bg-popover px-2 text-right tabular-nums",a?"text-foreground":"text-muted-foreground/50"),children:i}),(0,eT.jsx)("span",{className:(0,ny.cn)("flex-1 whitespace-pre pl-3 pr-4",a?"border-l-2 border-foreground text-foreground":"border-l-2 border-transparent text-foreground/80"),children:e||" "})]},i)})})})}function lC({startLine:e,code:t,highlight:n}){let r=t.replace(/\n$/,"").split("\n");return(0,eT.jsx)("pre",{className:"overflow-x-auto rounded-sm border border-border bg-background/60 py-2 font-mono text-xs leading-relaxed",children:(0,eT.jsx)("code",{className:"block",children:r.map((t,r)=>{let i=e+r,a=i===n;return(0,eT.jsxs)("div",{className:(0,ny.cn)("flex",a&&"bg-foreground/[0.08]"),children:[(0,eT.jsx)("span",{className:(0,ny.cn)("w-10 shrink-0 select-none px-2 text-right tabular-nums",a?"text-foreground":"text-muted-foreground/50"),children:i}),(0,eT.jsx)("span",{className:(0,ny.cn)("flex-1 whitespace-pre pl-3 pr-4",a?"border-l-2 border-foreground text-foreground":"border-l-2 border-transparent text-foreground/80"),children:t||" "})]},i)})})})}function lA({fix:e}){let t=e.replace(/\n$/,"").split("\n");return(0,eT.jsx)("pre",{className:"overflow-x-auto rounded-sm border border-border bg-background/60 py-2 font-mono text-xs leading-relaxed",children:(0,eT.jsx)("code",{className:"block",children:t.map((e,t)=>{let n=e.startsWith("+"),r=e.startsWith("-");return(0,eT.jsx)("div",{className:(0,ny.cn)("flex whitespace-pre border-l-2 px-3",n&&"border-foreground bg-foreground/[0.07] text-foreground",r&&"border-muted-foreground/40 text-muted-foreground line-through decoration-muted-foreground/40",!n&&!r&&"border-transparent text-foreground/60"),children:e||" "},t)})})})}function lT({icon:e,children:t}){return(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(e,{className:"size-3.5"}),t]})}function lP({label:e,value:t,highlight:n}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)("tabular-nums",n?"text-[color:var(--sev-ok)]":"text-foreground"),children:t})]})}function lz({projectRoot:e,onAskAI:t,children:n}){let[r,i]=(0,eP.useState)(null),[a,s]=(0,eP.useState)(null),{copied:o,copy:l}=function(){let[e,t]=(0,eP.useState)(!1);return{copied:e,copy:(0,eP.useCallback)(e=>{navigator.clipboard?.writeText(e).then(()=>{t(!0),window.setTimeout(()=>t(!1),1400)})},[])}}(),d=(0,eP.useCallback)((e,t,n)=>{i({filePath:e,line:t,column:n})},[]),c=(0,eP.useCallback)(e=>s(e),[]),u=(0,eP.useCallback)(e=>{t?.(e),s(null)},[t]),m=(0,eP.useMemo)(()=>({projectRoot:e,viewFile:d,viewIssue:c,canAskAI:!!t,askAI:u}),[e,d,c,t,u]),p=r?oW[r.filePath]??null:null,f=a?o8(a):[],h=a?oV(a.severity):null;return(0,eT.jsxs)(lS.Provider,{value:m,children:[n,(0,eT.jsx)(oM,{open:!!r,onOpenChange:e=>!e&&i(null),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-3xl",children:r&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(si,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:r.filePath})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Source file preview"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[null!=r.line&&(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:["line ",r.line,null!=r.column?`:${r.column}`:""]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>l(le(e,r.filePath)),className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[o?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(oC,{className:"size-3.5"}),o?"Copied":"Copy path"]}),(0,eT.jsx)(lI,{absPath:le(e,r.filePath),line:r.line??1,column:r.column??1})]})]}),(0,eT.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:p?(0,eT.jsx)(lE,{code:p,highlight:r.line}):(0,eT.jsx)("p",{className:"p-6 text-sm text-muted-foreground",children:"No preview available for this file in the demo fixture. The installed CLI reads the real file from disk."})})]})})}),(0,eT.jsx)(oM,{open:!!a,onOpenChange:e=>!e&&s(null),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-2xl",children:a&&h&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",h.bg,h.text),children:h.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.source}),a.ruleId&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:a.ruleId}),a.code&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:a.code}),a.category&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.category}),null!=a.confidence&&(0,eT.jsxs)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:[Math.round(100*a.confidence),"% conf."]})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-sm leading-relaxed",children:a.title}),(0,eT.jsx)(oF,{className:"sr-only",children:"Issue detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>d(a.filePath,a.line,a.column),className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(si,{className:"size-3.5 text-muted-foreground"}),a.filePath,":",a.line]}),(0,eT.jsx)(lI,{absPath:le(e,a.filePath),line:a.line,column:a.column??1}),t&&(0,eT.jsxs)("button",{type:"button",onClick:()=>{let e;return u((e=[a.description,a.recommendation?`Suggested direction: ${a.recommendation}`:"",a.ruleId?`Rule: ${a.ruleId}`:"",a.code?`Code: ${a.code}`:"",a.cves?.length?`Advisories: ${a.cves.join(", ")}`:"",a.snippet?`
315
315
  Relevant code:
316
- ${a.snippet.code}`:""].filter(Boolean).join("\n"),{source:a.source,title:a.title,summary:e,filePath:a.filePath,line:a.line,severity:a.severity}))},className:"inline-flex items-center gap-1.5 rounded-sm bg-primary px-2.5 py-1.5 font-mono text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(e4,{className:"size-3.5"}),"Ask AI"]}),(0,eT.jsx)(lO,{issue:a}),a.fixable&&(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-2 py-1 font-mono text-[11px] text-[color:var(--sev-ok)]",children:"auto-fixable"})]}),a.dep&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eq,children:"Package"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:a.dep.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.dep.type})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"installed",value:a.dep.current}),a.dep.latest&&(0,eT.jsx)(lP,{label:"latest",value:a.dep.latest}),a.dep.fixedIn&&(0,eT.jsx)(lP,{label:"fixed in",value:a.dep.fixedIn,highlight:!0}),a.dep.license&&(0,eT.jsx)(lP,{label:"license",value:a.dep.license})]}),a.dep.fixedIn&&"—"!==a.dep.current&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-t border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:a.dep.current}),(0,eT.jsx)(oz,{className:"size-3 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-[color:var(--sev-ok)]",children:a.dep.fixedIn}),(0,eT.jsx)("span",{className:"ml-auto text-muted-foreground",children:"recommended upgrade"})]})]}),a.dep.usedIn&&a.dep.usedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"imported in:"}),a.dep.usedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]})]}),a.env&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eH,children:"Variable"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:a.env.key}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.env.scope})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs",children:[(0,eT.jsx)(lP,{label:"status",value:a.env.status,highlight:"exposed"===a.env.status}),(0,eT.jsx)(lP,{label:"value",value:a.env.sample??"—"})]})]}),a.env.definedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"declared in:"}),a.env.definedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]}),a.env.usedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"referenced in:"}),a.env.usedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]})]}),a.net&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eG,children:"Request"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 uppercase text-foreground",children:a.net.method}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:a.net.url})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"host",value:a.net.host}),(0,eT.jsx)(lP,{label:"client",value:a.net.client}),(0,eT.jsx)(lP,{label:"scheme",value:a.net.secure?"https":"http",highlight:!a.net.secure}),(0,eT.jsx)(lP,{label:"scope",value:a.net.external?"external":"internal"})]})]}),a.net.issues.length>0&&(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:a.net.issues.map((e,t)=>{let n=oV(e.severity);return(0,eT.jsxs)("li",{className:"flex items-start gap-2 text-xs leading-relaxed text-muted-foreground",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-1.5 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("span",{children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-foreground",children:e.kind})," — ",e.message]})]},t)})})]}),a.a11y&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eQ,children:"WCAG details"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-foreground",children:a.a11y.rule}),(0,eT.jsx)("span",{className:"truncate text-muted-foreground",children:a.a11y.selector})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"impact",value:a.a11y.impact,highlight:"critical"===a.a11y.impact}),(0,eT.jsx)(lP,{label:"principle",value:a.a11y.principle}),(0,eT.jsx)(lP,{label:"nodes",value:String(a.a11y.nodes)}),(0,eT.jsx)(lP,{label:"criteria",value:a.a11y.wcag.filter(e=>/^\d/.test(e))[0]??"—"})]})]})]}),a.cves&&a.cves.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eB,children:"Known advisories"}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.cves.map(e=>(0,eT.jsxs)("a",{href:`https://nvd.nist.gov/vuln/detail/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-sm border border-border bg-card px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[e,(0,eT.jsx)(oE,{className:"size-3 text-muted-foreground"})]},e))})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eY,children:"What's happening"}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:a.description})]}),a.snippet&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)(lT,{icon:si,children:"Code"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>d(a.filePath,a.line,a.column),className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:["view full file ",(0,eT.jsx)(a4,{className:"size-3"})]})]}),(0,eT.jsx)(lC,{startLine:a.snippet.startLine,code:a.snippet.code,highlight:a.line})]}),a.related&&a.related.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oT,children:"Diagnostic chain"}),(0,eT.jsx)("ol",{className:"relative ml-2 border-l border-border",children:a.related.map((e,t)=>(0,eT.jsxs)("li",{className:"relative py-1.5 text-sm leading-relaxed text-muted-foreground",style:{paddingLeft:`${12*e.depth+20}px`},children:[(0,eT.jsx)("span",{className:"absolute top-3 size-1.5 rounded-full bg-muted-foreground/40",style:{left:`${12*e.depth+4}px`},"aria-hidden":!0}),e.message]},t))})]}),a.recommendation&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"How to fix"}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card p-3",children:(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:a.recommendation})})]}),a.suggestedFix&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"Suggested fix"}),(0,eT.jsx)(lA,{fix:a.suggestedFix})]}),"lint"===a.source&&a.fixable&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"Auto-fix command"}),(0,eT.jsxs)("code",{className:"rounded-sm border border-border bg-background/60 px-3 py-2 font-mono text-xs text-foreground",children:["eslint --fix ",a.filePath]})]}),f.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eY,children:"Resources & docs"}),(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:f.map(e=>(0,eT.jsx)("li",{children:(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-sm border border-border bg-card px-3 py-2 text-sm transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.label}),(0,eT.jsx)(oE,{className:"size-3.5 shrink-0 text-muted-foreground"})]})},e.href))})]})]})]})})})]})}function lO({issue:e}){let t=lN(lk),n=l_().has(lh(e)),[r,i]=(0,eP.useState)(!1),[a,s]=(0,eP.useState)(null),[o,l]=(0,eP.useState)(!1),[d,c]=(0,eP.useState)("");function u(){l(!1),c("")}function m(t){let n,r,{created:a}=(n=lh(e),(r=lm().find(e=>lg(e)===n))?(t&&r.groupId!==t&&lx(r.id,{groupId:t}),{task:r,created:!1}):{task:lf({title:e.title,source:e.source,severity:e.severity,filePath:e.filePath,line:e.line,groupId:t,priority:function(e){switch(e){case"critical":case"high":case"error":return"high";case"medium":case"warning":return"medium";default:return"low"}}(e.severity),note:e.recommendation,issue:e}),created:!0});s(a?"added":"exists"),window.setTimeout(()=>s(null),1600),i(!1),u()}function p(){let e=d.trim();e&&m(lw(e).id)}let f=a||n?ox:e7;return(0,eT.jsxs)(a5,{open:r,onOpenChange:e=>{i(e),e||u()},children:[(0,eT.jsxs)(a6,{className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors",n?"border-foreground/40 bg-secondary text-foreground":"border-border bg-card text-foreground hover:bg-secondary"),children:[(0,eT.jsx)(f,{className:(0,ny.cn)("size-3.5",n?"text-foreground":"text-muted-foreground")}),"added"===a?"Tracked":"exists"===a?"Already tracked":n?"Tracked":"Track task",(0,eT.jsx)(a4,{className:"size-3 rotate-90 text-muted-foreground"})]}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-52",children:[(0,eT.jsx)("p",{className:"px-1.5 py-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:n?"Update task group":"Add to task board"}),(0,eT.jsxs)(a8,{onClick:()=>m(void 0),children:[(0,eT.jsx)(e7,{className:"size-3.5 text-muted-foreground"}),"Track (no group)"]}),t.length>0&&(0,eT.jsx)(a7,{}),t.map(e=>(0,eT.jsxs)(a8,{onClick:()=>m(e.id),children:[(0,eT.jsx)("span",{className:"size-2 rounded-full border border-muted-foreground","aria-hidden":!0}),e.name]},e.id)),(0,eT.jsx)(a7,{}),o?(0,eT.jsxs)("div",{className:"flex items-center gap-1.5 px-1.5 py-1",onKeyDown:e=>e.stopPropagation(),children:[(0,eT.jsx)("input",{autoFocus:!0,value:d,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p())},placeholder:"New group name",className:"w-full rounded-sm border border-border bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"button",onClick:p,disabled:!d.trim(),className:"rounded-sm bg-primary px-2 py-1 font-mono text-[11px] text-primary-foreground disabled:opacity-40",children:"Add"})]}):(0,eT.jsxs)(a8,{closeOnClick:!1,onClick:()=>l(!0),children:[(0,eT.jsx)(oO,{className:"size-3.5 text-muted-foreground"}),"New group…"]})]})]})}function lM({issue:e,variant:t="badge",className:n}){return l_().has(lh(e))?"dot"===t?(0,eT.jsx)(ox,{className:(0,ny.cn)("size-3.5 shrink-0 text-foreground",n),"aria-label":"Tracked in Task Manager"}):(0,eT.jsxs)("span",{title:"Tracked in Task Manager",className:(0,ny.cn)("inline-flex items-center gap-1 rounded-sm border border-foreground/40 bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground",n),children:[(0,eT.jsx)(ox,{className:"size-3"}),"tracked"]}):null}function lR({path:e,line:t,column:n,className:r,children:i}){let{viewFile:a}=l$();return(0,eT.jsx)("button",{type:"button",onClick:r=>{r.stopPropagation(),a(e,t,n)},className:(0,ny.cn)("inline-flex items-center gap-1 font-mono text-xs text-foreground/80 underline decoration-border underline-offset-2 transition-colors hover:text-foreground hover:decoration-foreground",r),children:i??(0,eT.jsxs)(eT.Fragment,{children:[e,null!=t?`:${t}`:""]})})}let lD={security:"security",types:"types",deps:"deps",lint:"lint",database:"database",tests:"tests",perf:"performance",a11y:"accessibility",env:"env",network:"network",docs:"docs"};function lL({label:e,value:t,sub:n,accent:r,onClick:i}){let a=(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e}),i&&(0,eT.jsx)(a4,{className:"size-3.5 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5"})]}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:r},children:t}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:n})]});return i?(0,eT.jsx)("button",{type:"button",onClick:i,className:"group flex flex-col gap-2 overflow-hidden rounded-xl bg-card p-4 text-left text-card-foreground ring-1 ring-foreground/10 transition-colors hover:ring-foreground/25",children:a}):(0,eT.jsx)(s8,{className:"gap-2 p-4",children:a})}function lU({category:e,onSelect:t}){var n;let r=(n=e.score)>=80?"var(--sev-ok)":n>=60?"var(--sev-medium)":n>=40?"var(--sev-high)":"var(--sev-critical)";return(0,eT.jsxs)("button",{type:"button",onClick:t,disabled:!t,className:"group flex flex-col gap-1.5 rounded-sm p-1.5 text-left transition-colors enabled:hover:bg-secondary/50",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,eT.jsx)("span",{className:"truncate text-muted-foreground group-enabled:group-hover:text-foreground",children:e.label}),(0,eT.jsxs)("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/60",children:[e.issues," ",1===e.issues?"issue":"issues"]})]}),(0,eT.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,eT.jsx)("span",{className:"font-mono tabular-nums",style:{color:r},children:e.score}),t&&(0,eT.jsx)(a4,{className:"size-3 text-muted-foreground/40 transition-transform group-hover:translate-x-0.5"})]})]}),(0,eT.jsx)(om,{value:e.score,className:"h-1.5"})]})}function lZ({icon:e,label:t,value:n,onClick:r}){let i=(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(e,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70",children:t}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:n})]})]}),a="flex min-w-0 items-center gap-2.5 rounded-sm px-3 py-2";return r?(0,eT.jsx)("button",{type:"button",onClick:r,className:`${a} text-left transition-colors hover:bg-secondary/50`,children:i}):(0,eT.jsx)("div",{className:a,children:i})}function lF({report:e,history:t,insights:n,onSelectTab:r}){let i,a,{lint:s,types:o,security:l}=e,{viewIssue:d,viewFile:c}=l$(),u=ok(e,n),m=l.findings.filter(e=>"critical"===e.severity).length,p=l.findings.filter(e=>"high"===e.severity).length,f=t.length>=2?t[t.length-2].score:null,h=null!=f?u.score-f:null,g=function(e){let{lint:t,types:n,security:r}=e,i=[];for(let e of r.findings)("critical"===e.severity||"high"===e.severity)&&i.push({id:`sec-${e.id}`,icon:eB,severity:e.severity,title:e.title,detail:`${e.filePath}:${e.line}`,issue:oK(e)});for(let e of r.dependencies)e.fixedIn&&("critical"===e.severity||"high"===e.severity)&&i.push({id:`dep-${e.name}`,icon:s6,severity:e.severity,title:`Upgrade ${e.name} to ${e.fixedIn}`,detail:e.cves.join(", ")||e.title,tab:"deps"});return t.fixableCount>0&&i.push({id:"lint-fix",icon:s4,severity:"warning",title:`Auto-fix ${t.fixableCount} lint ${1===t.fixableCount?"issue":"issues"}`,detail:"eslint . --fix",tab:"lint"}),n.diagnostics.length>0&&i.push({id:"types",icon:s5,severity:"high",title:`Resolve ${n.diagnostics.length} type ${1===n.diagnostics.length?"error":"errors"}`,detail:"tsc --noEmit",tab:"types"}),i.sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank).slice(0,6)}(e),x=(i=new Map,a=e=>i.set(e,(i.get(e)??0)+1),e.lint.messages.forEach(e=>a(e.filePath)),e.types.diagnostics.forEach(e=>a(e.filePath)),e.security.findings.forEach(e=>a(e.filePath)),[...i.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,8)),v=u.categories.reduce((e,t)=>e+t.issues,0),y=u.categories.filter(e=>0===e.issues).length,b=e=>{e&&r&&r(e)},k=["critical","high","medium","low","info"].map((e,t)=>({label:oV(e).label,value:l.findings.filter(t=>t.severity===e).length,color:`var(--chart-${t+1})`}));return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Project health"}),(0,eT.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Weighted across ",u.categories.length," analysis surfaces"]})]}),(0,eT.jsx)(o_,{report:e,insights:n})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-4 p-6",children:[(0,eT.jsx)(oh,{score:u.score,grade:u.grade}),(0,eT.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[null!=h&&(0,eT.jsxs)("span",{className:"font-mono tabular-nums",style:{color:h>=0?"var(--sev-ok)":"var(--sev-critical)"},children:[h>=0?"+":"",h]}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:"vs previous run"})]})]}),(0,eT.jsxs)(s8,{className:"flex flex-col gap-3 p-6 lg:col-span-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold",children:"Score breakdown"}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:"issues · score"})]}),(0,eT.jsx)("div",{className:"grid gap-x-4 gap-y-1 sm:grid-cols-2",children:u.categories.map(e=>(0,eT.jsx)(lU,{category:e,onSelect:r?()=>b(lD[e.key]):void 0},e.key))})]})]}),(0,eT.jsxs)(s8,{className:"grid grid-cols-2 gap-1 p-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,eT.jsx)(lZ,{icon:te,label:"Framework",value:e.meta.project.framework}),(0,eT.jsx)(lZ,{icon:s9,label:"Package manager",value:e.meta.project.packageManager}),(0,eT.jsx)(lZ,{icon:s3,label:"AI review",value:e.meta.aiEnabled?"Enabled":"Skipped",onClick:r?()=>b("security"):void 0}),(0,eT.jsx)(lZ,{icon:i4,label:"Duration",value:`${(e.meta.durationMs/1e3).toFixed(1)}s`}),(0,eT.jsx)(lZ,{icon:eB,label:"Total issues",value:String(v)}),(0,eT.jsx)(lZ,{icon:s9,label:"Clean surfaces",value:`${y}/${u.categories.length}`})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,eT.jsxs)(s8,{className:"flex flex-col gap-3 p-6 lg:col-span-3",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold",children:"Health trend"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>b("trends"),disabled:!r,className:"inline-flex items-center gap-1 font-mono text-xs text-muted-foreground transition-colors enabled:hover:text-foreground",children:[t.length," runs",r&&(0,eT.jsx)(s2,{className:"size-3"})]})]}),(0,eT.jsx)(og,{data:t})]}),(0,eT.jsx)(lL,{label:"Lint errors",value:s.errorCount,sub:`${s.warningCount} warnings \xb7 ${s.fixableCount} auto-fixable`,accent:s.errorCount>0?"var(--sev-critical)":"var(--sev-ok)",onClick:r?()=>b("lint"):void 0}),(0,eT.jsx)(lL,{label:"Type errors",value:o.diagnostics.length,sub:o.unavailable?"TypeScript not detected":"from tsc --noEmit",accent:o.diagnostics.length>0?"var(--sev-high)":"var(--sev-ok)",onClick:r?()=>b("types"):void 0}),(0,eT.jsx)(lL,{label:"Security findings",value:l.findings.length,sub:`${m} critical \xb7 ${p} high \xb7 ${l.dependencies.length} vuln deps`,accent:m>0?"var(--sev-critical)":p>0?"var(--sev-high)":"var(--sev-ok)",onClick:r?()=>b("security"):void 0}),(0,eT.jsx)("div",{className:"lg:col-span-2",children:(0,eT.jsx)(oS,{title:"Recommended next actions",children:0===g.length?(0,eT.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"All clear — nothing urgent to address."}):(0,eT.jsx)("ol",{className:"flex flex-col",children:g.map((e,t)=>{let n=oV(e.severity),r=e.icon;return(0,eT.jsx)("li",{className:"border-t border-border first:border-t-0",children:(0,eT.jsxs)("button",{type:"button",onClick:()=>{e.issue?d(e.issue):b(e.tab)},className:"group flex w-full items-start gap-3 py-2.5 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:"mt-0.5 font-mono text-xs tabular-nums text-muted-foreground",children:String(t+1).padStart(2,"0")}),(0,eT.jsx)(r,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.detail})]}),(0,eT.jsx)("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${n.bg} ${n.text}`,children:n.label}),(0,eT.jsx)(a4,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40 transition-transform group-hover:translate-x-0.5"})]})},e.id)})})})}),(0,eT.jsx)(oS,{title:"Findings by severity",action:r?(0,eT.jsxs)("button",{type:"button",onClick:()=>b("security"),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:["view ",(0,eT.jsx)(s2,{className:"size-3"})]}):void 0,children:(0,eT.jsx)(o$,{segments:k})}),(0,eT.jsx)("div",{className:"lg:col-span-3",children:(0,eT.jsx)(oS,{title:"Most affected files",action:(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:["issues ",(0,eT.jsx)(s2,{className:"size-3"})]}),children:(0,eT.jsx)("div",{className:"sm:columns-2 sm:gap-6",children:(0,eT.jsx)(oI,{rows:x,emptyLabel:"No issues across any files.",onSelect:e=>c(e)})})})})]})]})}let lB=eL("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),lV=eL("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),lq=eL("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),lW=eL("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),lH=eL("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),lG=[{key:"score",label:"Health score",invert:!1,stroke:"var(--chart-1)"},{key:"lintErrors",label:"Lint errors",invert:!0,stroke:"var(--chart-2)"},{key:"lintWarnings",label:"Lint warnings",invert:!0,stroke:"var(--chart-3)"},{key:"typeErrors",label:"Type errors",invert:!0,stroke:"var(--chart-4)"},{key:"securityFindings",label:"Security findings",invert:!0,stroke:"var(--chart-5)"}];function lK({history:e,report:t}){let[n,r]=(0,eP.useState)("score"),[i,a]=(0,eP.useState)(null),s=lG.find(e=>e.key===n),o=(0,eP.useMemo)(()=>[...e].reverse(),[e]);if(0===e.length)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(lW,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No run history yet"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["Projectlens records a trend point after every analysis in ",(0,eT.jsx)("span",{className:"font-mono",children:".projectlens/history.json"}),". Run checks a few times to watch your project's health evolve here."]})]})]});let l=e[0],d=e[e.length-1],c=d.score-l.score;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:lG.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.key),className:(0,ny.cn)("flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm transition-colors",n===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)("span",{className:"size-2 rounded-[2px]",style:{background:e.stroke},"aria-hidden":!0}),e.label]},e.key))}),(0,eT.jsx)(s8,{className:"p-4",children:(0,eT.jsx)(lJ,{points:e,metric:s,hover:i,onHover:a})}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)(lW,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"font-mono text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Run history"}),(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:[e.length," runs"]})]}),(0,eT.jsx)("div",{className:"overflow-hidden rounded-sm border border-border",children:(0,eT.jsxs)("table",{className:"w-full text-sm",children:[(0,eT.jsx)("thead",{children:(0,eT.jsxs)("tr",{className:"border-b border-border bg-secondary/30 text-left font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:[(0,eT.jsx)("th",{className:"px-3 py-2 font-medium",children:"When"}),(0,eT.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Score"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Lint"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Types"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Security"}),(0,eT.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Δ"})]})}),(0,eT.jsx)("tbody",{children:o.map((t,n)=>{let r=e.length-1-n-1,i=r>=0?e[r]:null,a=i?t.score-i.score:0,s=0===n;return(0,eT.jsxs)("tr",{className:(0,ny.cn)("border-b border-border last:border-0 transition-colors hover:bg-secondary/30",s&&"bg-secondary/20"),children:[(0,eT.jsxs)("td",{className:"px-3 py-2 font-mono text-xs text-foreground",children:[l0(t.timestamp),s&&(0,eT.jsx)("span",{className:"ml-2 rounded-sm bg-primary px-1 py-0.5 font-mono text-[9px] uppercase text-primary-foreground",children:"latest"})]}),(0,eT.jsx)("td",{className:"px-3 py-2 text-right font-mono text-foreground",children:t.score}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.lintErrors+t.lintWarnings}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.typeErrors}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.securityFindings}),(0,eT.jsx)("td",{className:"px-3 py-2 text-right",children:(0,eT.jsx)(lY,{value:a})})]},t.runId)})})]})})]})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)(oS,{title:"Current",children:[(0,eT.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-4xl font-semibold tabular-nums text-foreground",children:t.health.score}),(0,eT.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:"/ 100"})]}),(0,eT.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-xs text-foreground",children:t.health.grade}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"grade"})]})]}),(0,eT.jsx)(oS,{title:"Since first run",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsx)(lX,{label:"Score change",value:lQ(c),positive:c>0,negative:c<0}),(0,eT.jsx)(lX,{label:"Lint resolved",value:lQ(l.lintErrors+l.lintWarnings-(d.lintErrors+d.lintWarnings)),positive:l.lintErrors+l.lintWarnings-(d.lintErrors+d.lintWarnings)>0}),(0,eT.jsx)(lX,{label:"Type errors fixed",value:lQ(l.typeErrors-d.typeErrors),positive:l.typeErrors-d.typeErrors>0}),(0,eT.jsx)(lX,{label:"Security closed",value:lQ(l.securityFindings-d.securityFindings),positive:l.securityFindings-d.securityFindings>0})]})}),(0,eT.jsx)(oS,{title:"Best & worst",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5 text-sm",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Peak score"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.max(...e.map(e=>e.score))})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Lowest score"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.min(...e.map(e=>e.score))})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Average"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.round(e.reduce((e,t)=>e+t.score,0)/e.length)})]})]})})]})]})}function lJ({points:e,metric:t,hover:n,onHover:r}){if(e.length<2)return(0,eT.jsx)("div",{className:"flex h-[140px] items-center justify-center text-xs text-muted-foreground",children:"Need at least two runs to plot a trend."});let i=e.map(e=>e[t.key]),a=Math.max(...i),s=Math.min(...i),o=a-s||1,l=e.map((n,r)=>({x:r/(e.length-1)*100,y:8+(1-(n[t.key]-s)/o)*124,p:n})),d=l.map((e,t)=>`${0===t?"M":"L"} ${e.x} ${e.y}`).join(" "),c=`${d} L 100 140 L 0 140 Z`,u=null!=n?l[n]:l[l.length-1];return(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsxs)("svg",{viewBox:"0 0 100 140",preserveAspectRatio:"none",className:"h-[160px] w-full overflow-visible",role:"img","aria-label":`${t.label} across ${e.length} runs`,children:[(0,eT.jsx)("defs",{children:(0,eT.jsxs)("linearGradient",{id:`fill-${t.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,eT.jsx)("stop",{offset:"0%",stopColor:t.stroke,stopOpacity:"0.25"}),(0,eT.jsx)("stop",{offset:"100%",stopColor:t.stroke,stopOpacity:"0"})]})}),[.25,.5,.75].map(e=>(0,eT.jsx)("line",{x1:"0",x2:100,y1:8+124*e,y2:8+124*e,stroke:"var(--border)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",strokeDasharray:"2 2"},e)),(0,eT.jsx)("path",{d:c,fill:`url(#fill-${t.key})`}),(0,eT.jsx)("path",{d:d,fill:"none",stroke:t.stroke,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"}),null!=n&&(0,eT.jsx)("line",{x1:u.x,x2:u.x,y1:8,y2:140,stroke:"var(--foreground)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",strokeOpacity:"0.4"}),(0,eT.jsx)("circle",{cx:u.x,cy:u.y,r:"2.5",fill:t.stroke,vectorEffect:"non-scaling-stroke"}),l.map((t,n)=>(0,eT.jsx)("rect",{x:t.x-100/e.length/2,y:0,width:100/e.length,height:140,fill:"transparent",onMouseEnter:()=>r(n),onMouseLeave:()=>r(null)},n))]}),(0,eT.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"font-mono text-muted-foreground",children:l0(u.p.timestamp)}),(0,eT.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,eT.jsxs)("span",{className:"text-muted-foreground",children:[t.label,":"]}),(0,eT.jsx)("span",{className:"font-mono font-semibold text-foreground",children:u.p[t.key]})]})]})]})}function lY({value:e}){if(0===e)return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-0.5 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(lq,{className:"size-3"}),"0"]});let t=e>0;return(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-0.5 font-mono text-xs",t?"text-foreground":"text-muted-foreground"),children:[t?(0,eT.jsx)(lB,{className:"size-3"}):(0,eT.jsx)(lV,{className:"size-3"}),lQ(e)]})}function lX({label:e,value:t,positive:n,negative:r}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1 font-mono",n?"font-semibold text-foreground":r?"text-muted-foreground":"text-foreground"),children:[n?(0,eT.jsx)(lB,{className:"size-3"}):r?(0,eT.jsx)(lV,{className:"size-3"}):(0,eT.jsx)(lH,{className:"size-3"}),t]})]})}function lQ(e){return e>0?`+${e}`:`${e}`}function l0(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})+" "+t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}let l1=eL("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),l2=eL("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),l4=eL("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),l5=eL("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),l6={high:"High",medium:"Medium",low:"Low"};function l3(){let e=lN(lm),t=lN(lk),n=lu(),{viewIssue:r}=l$(),[i,a]=(0,eP.useState)(""),[s,o]=(0,eP.useState)("all"),[l,d]=(0,eP.useState)("all"),[c,u]=(0,eP.useState)(""),[m,p]=(0,eP.useState)(""),[f,h]=(0,eP.useState)(!1),[g,x]=(0,eP.useState)(null),[v,y]=(0,eP.useState)(null),[b,k]=(0,eP.useState)(null),[j,w]=(0,eP.useState)(null),N=(0,eP.useMemo)(()=>e.filter(e=>("all"===s||e.priority===s)&&("all"===l||("none"===l?!e.groupId:e.groupId===l))),[e,s,l]),_=(0,eP.useMemo)(()=>{let t=new Map,n=0;for(let r of e)r.groupId?t.set(r.groupId,(t.get(r.groupId)??0)+1):n++;return{map:t,ungrouped:n}},[e]),S=(0,eP.useMemo)(()=>{let e={};for(let t of n)e[t.id]=[];for(let t of N)e[t.columnId]||(e[t.columnId]=[]),e[t.columnId].push(t);return e},[N,n]),$=(0,eP.useMemo)(()=>new Set(n.filter(e=>e.done).map(e=>e.id)),[n]),I=e.filter(e=>$.has(e.columnId)).length;function E(e){e.issue?r(e.issue):x(e)}function C(){y(null),k(null),w(null)}return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=i.trim();t&&(lf({title:t,groupId:"all"!==l&&"none"!==l?l:void 0,columnId:n[0]?.id}),a(""))},className:"flex flex-1 items-center gap-2",children:[(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(oO,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:i,onChange:e=>a(e.target.value),placeholder:"Add a task…",className:"w-full rounded-sm border border-border bg-card py-2 pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring","aria-label":"New task title"})]}),(0,eT.jsx)("button",{type:"submit",disabled:!i.trim(),className:"rounded-sm bg-primary px-3 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-40",children:"Add"})]}),(0,eT.jsx)("div",{className:"flex items-center gap-1 rounded-sm border border-border bg-card p-1",children:["all","high","medium","low"].map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>o(e),className:(0,ny.cn)("rounded-sm px-2.5 py-1 text-xs capitalize transition-colors",s===e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e},e))})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)(de,{label:"All",count:e.length,active:"all"===l,onClick:()=>d("all")}),_.ungrouped>0&&(0,eT.jsx)(de,{label:"Ungrouped",count:_.ungrouped,active:"none"===l,onClick:()=>d("none")}),t.map(e=>(0,eT.jsx)(de,{label:e.name,count:_.map.get(e.id)??0,active:l===e.id,onClick:()=>d(e.id),onRemove:()=>{var t;t=e.id,lj(lk().filter(e=>e.id!==t)),lp(lm().map(e=>e.groupId===t?{...e,groupId:void 0}:e)),l===e.id&&d("all")}},e.id)),(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=c.trim();if(!t)return;let n=lw(t);u(""),d(n.id)},className:"ml-auto flex items-center gap-1",children:[(0,eT.jsx)("input",{value:c,onChange:e=>u(e.target.value),placeholder:"New group…","aria-label":"New group name",className:"w-32 rounded-sm border border-border bg-card px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"submit",disabled:!c.trim(),"aria-label":"Create group",className:"inline-flex size-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:(0,eT.jsx)(oO,{className:"size-3.5"})})]})]}),0===e.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(e7,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No tasks yet"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["Add a task above, or open any finding across the dashboard and click"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Track task"})," to capture it here. Drag cards between columns, and use the column menu to rename or remove columns."]})]})]}):(0,eT.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-2",children:[n.map(e=>(0,eT.jsx)(l9,{column:e,tasks:S[e.id]??[],groups:t,isDropTarget:b===e.id,overTask:j,dragId:v,showClear:!!e.done&&I>0,canDelete:n.length>1,onClear:lb,onRename:t=>{var n;return n=e.id,void lc(ld().map(e=>e.id===n?{...e,name:t.trim()}:e))},onDelete:()=>(function(e){let t=ld();if(t.length<=1)return;let n=t.filter(t=>t.id!==e);lc(n);let r=n[0].id;lp(lm().map(t=>t.columnId===e?{...t,columnId:r}:t))})(e.id),onOpenTask:E,onDragStartTask:e=>y(e),onDragEndTask:C,onColumnDragOver:()=>{k(e.id),w(null)},onColumnDrop:()=>{var t;return t=e.id,void(v&&lv(v,t),C())},onTaskDragOver:t=>{w(t),k(e.id)},onTaskDrop:t=>{var n;return n=e.id,void(v&&v!==t&&lv(v,n,t),C())}},e.id)),(0,eT.jsx)("div",{className:"w-72 shrink-0",children:f?(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=m.trim();t&&(!function(e){let t={id:ll("col"),name:e.trim()},n=ld(),r=n.findIndex(e=>e.done);if(r>=0){let e=[...n];e.splice(r,0,t),lc(e)}else lc([...n,t])}(t),p(""),h(!1))},className:"flex items-center gap-1 rounded-sm border border-border bg-card p-2",children:[(0,eT.jsx)("input",{autoFocus:!0,value:m,onChange:e=>p(e.target.value),onBlur:()=>!m.trim()&&h(!1),placeholder:"Column name…","aria-label":"New column name",className:"w-full rounded-sm border border-border bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"submit",disabled:!m.trim(),"aria-label":"Confirm new column",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-sm bg-primary text-primary-foreground disabled:opacity-40",children:(0,eT.jsx)(iq,{className:"size-3.5"})})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-sm border border-dashed border-border bg-card/40 py-2.5 font-mono text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground",children:[(0,eT.jsx)(oO,{className:"size-3.5"}),"Add column"]})})]}),(0,eT.jsx)(l7,{task:g,columns:n,groups:t,onClose:()=>x(null),onViewIssue:e=>{x(null),r(e)}})]})}function l9({column:e,tasks:t,groups:n,isDropTarget:r,overTask:i,dragId:a,showClear:s,canDelete:o,onClear:l,onRename:d,onDelete:c,onOpenTask:u,onDragStartTask:m,onDragEndTask:p,onColumnDragOver:f,onColumnDrop:h,onTaskDragOver:g,onTaskDrop:x}){let[v,y]=(0,eP.useState)(!1),[b,k]=(0,eP.useState)(e.name),j=(0,eP.useRef)(null);function w(){let t=b.trim();t&&t!==e.name?d(t):k(e.name),y(!1)}return(0,eT.jsxs)("div",{className:"flex w-72 shrink-0 flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("size-2 shrink-0 rounded-full",e.done?"bg-foreground":"bg-muted-foreground"),"aria-hidden":!0}),v?(0,eT.jsx)("input",{ref:j,autoFocus:!0,value:b,onChange:e=>k(e.target.value),onBlur:w,onKeyDown:t=>{"Enter"===t.key&&w(),"Escape"===t.key&&(k(e.name),y(!1))},className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-1.5 py-0.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","aria-label":"Column name"}):(0,eT.jsx)("h3",{className:"truncate font-mono text-xs font-semibold uppercase tracking-wide text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:t.length}),(0,eT.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[s&&(0,eT.jsxs)("button",{type:"button",onClick:l,className:"inline-flex items-center gap-1 font-mono text-[10px] uppercase text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(l1,{className:"size-3"}),"clear"]}),(0,eT.jsxs)(a5,{children:[(0,eT.jsx)(a6,{"aria-label":"Column options",className:"inline-flex size-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:(0,eT.jsx)(l4,{className:"size-3.5"})}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-40",children:[(0,eT.jsxs)(a8,{onClick:()=>{k(e.name),y(!0)},children:[(0,eT.jsx)(l5,{className:"size-3.5 text-muted-foreground"}),"Rename column"]}),(0,eT.jsxs)(a8,{variant:"destructive",disabled:!o,onClick:c,children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete column"]})]})]})]})]}),(0,eT.jsx)("div",{onDragOver:e=>{e.preventDefault(),f()},onDrop:e=>{e.preventDefault(),h()},className:(0,ny.cn)("flex min-h-24 flex-1 flex-col gap-2 rounded-sm border border-dashed p-2 transition-colors",r?"border-foreground/40 bg-secondary/40":"border-border"),children:0===t.length?(0,eT.jsx)("p",{className:"px-1 py-4 text-center font-mono text-[11px] text-muted-foreground/60",children:a?"drop here":"empty"}):t.map(e=>(0,eT.jsx)(l8,{task:e,groups:n,isDragging:a===e.id,showInsertLine:i===e.id&&null!==a&&a!==e.id,onOpen:()=>u(e),onDragStart:()=>m(e.id),onDragEnd:p,onDragOver:()=>g(e.id),onDrop:()=>x(e.id)},e.id))})]})}function l8({task:e,groups:t,isDragging:n,showInsertLine:r,onOpen:i,onDragStart:a,onDragEnd:s,onDragOver:o,onDrop:l}){let d=t.find(t=>t.id===e.groupId);return(0,eT.jsx)("div",{draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.id),a()},onDragEnd:s,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),o()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),l()},className:(0,ny.cn)("rounded-sm transition-opacity",r&&"border-t-2 border-foreground/50 pt-0.5",n&&"opacity-40"),children:(0,eT.jsxs)(s8,{className:"group gap-0 p-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,eT.jsx)(l2,{className:"mt-0.5 size-3.5 shrink-0 cursor-grab text-muted-foreground/40","aria-hidden":!0}),(0,eT.jsx)(dt,{priority:e.priority}),(0,eT.jsx)("button",{type:"button",onClick:i,className:"min-w-0 flex-1 text-pretty text-left text-sm leading-snug text-foreground transition-colors hover:text-foreground",children:e.title}),e.issue&&(0,eT.jsx)(oE,{className:"mt-0.5 size-3 shrink-0 text-muted-foreground/50","aria-hidden":!0}),(0,eT.jsx)("button",{type:"button",onClick:()=>ly(e.id),"aria-label":"Delete task",className:"shrink-0 text-muted-foreground/50 opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(e.source||e.filePath||d)&&(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 pl-5",children:[d&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border bg-background px-1.5 py-0.5 font-mono text-[9px] text-foreground",children:[(0,eT.jsx)("span",{className:"size-1.5 rounded-full bg-foreground","aria-hidden":!0}),d.name]}),e.source&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[9px] uppercase text-muted-foreground",children:e.source}),e.filePath&&(0,eT.jsx)(lR,{path:e.filePath,line:e.line,className:"text-[10px]"})]})]})})}function l7({task:e,columns:t,groups:n,onClose:r,onViewIssue:i}){return(0,eT.jsx)(sO,{open:null!==e,onOpenChange:e=>!e&&r(),children:(0,eT.jsx)(sL,{className:"sm:max-w-md",children:e&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(sU,{children:[(0,eT.jsx)(sZ,{className:"text-pretty pr-6",children:e.title}),(0,eT.jsxs)(sF,{children:["Created ",new Date(e.createdAt).toLocaleString()," · Updated"," ",new Date(e.updatedAt).toLocaleString()]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Column",(0,eT.jsx)("select",{value:e.columnId,onChange:t=>lx(e.id,{columnId:t.target.value}),className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:t.map(e=>(0,eT.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Priority",(0,eT.jsx)("select",{value:e.priority,onChange:t=>lx(e.id,{priority:t.target.value}),className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:["high","medium","low"].map(e=>(0,eT.jsx)("option",{value:e,children:l6[e]},e))})]})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Group",(0,eT.jsxs)("select",{value:e.groupId??"",onChange:t=>{lx(e.id,{groupId:t.target.value||void 0})},className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:[(0,eT.jsx)("option",{value:"",children:"No group"}),n.map(e=>(0,eT.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Notes",(0,eT.jsx)("textarea",{value:e.note??"",onChange:t=>lx(e.id,{note:t.target.value}),rows:4,placeholder:"Add details, links, or a remediation plan…",className:"resize-y rounded-sm border border-border bg-background px-2 py-1.5 text-sm leading-relaxed text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),e.source&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 rounded-sm border border-border bg-background p-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.source}),e.severity&&(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:e.severity})]}),e.issue?.recommendation&&(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:e.issue.recommendation}),e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})}),e.issue&&o8(e.issue).length>0&&(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o8(e.issue).map(e=>(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"}),e.label]},e.href))}),e.issue&&(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.issue),className:"inline-flex items-center justify-center gap-1.5 self-start rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(oE,{className:"size-3.5 text-muted-foreground"}),"View full analysis"]})]}),!e.source&&e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{ly(e.id),r()},className:"inline-flex items-center justify-center gap-1.5 self-start rounded-sm border border-destructive/40 px-2.5 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete task"]})]})]})})})}function de({label:e,count:t,active:n,onClick:r,onRemove:i}){return(0,eT.jsxs)("span",{className:(0,ny.cn)("group/chip inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1 text-xs transition-colors",n?"border-foreground/40 bg-secondary text-foreground":"border-border bg-card text-muted-foreground hover:text-foreground"),children:[(0,eT.jsxs)("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1.5",children:[e,(0,eT.jsx)("span",{className:"font-mono text-[10px] tabular-nums text-muted-foreground",children:t})]}),i&&(0,eT.jsx)("button",{type:"button",onClick:i,"aria-label":`Delete group ${e}`,className:"text-muted-foreground/50 transition-colors hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3"})})]})}function dt({priority:e}){return(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-2 shrink-0 rounded-full","high"===e?"bg-foreground":"medium"===e?"bg-muted-foreground":"border border-muted-foreground bg-transparent"),"aria-hidden":!0,title:`${e} priority`})}function dn({active:e,onClick:t,children:n,count:r}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:`flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors ${e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[n,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:r})]})}function dr({msg:e,showFile:t}){let{viewIssue:n}=l$(),r=oV(e.severity);return(0,eT.jsx)("div",{className:"border-t border-border first:border-t-0",children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>n(oH(e)),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(oH(e)))},className:"flex w-full cursor-pointer items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${r.dot}`,"aria-hidden":!0}),(0,eT.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"text-sm text-foreground",children:e.message}),(0,eT.jsxs)("span",{className:"mt-1 flex flex-wrap items-center gap-2 font-mono text-xs text-muted-foreground",children:[t&&(0,eT.jsx)(lR,{path:e.filePath,line:e.line,column:e.column}),!t&&(0,eT.jsxs)("span",{children:[e.line,":",e.column]}),!t&&e.ruleId&&(0,eT.jsx)("span",{className:`rounded-sm px-1.5 py-0.5 ${r.bg} ${r.text}`,children:e.ruleId}),e.fixable&&(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 text-[color:var(--sev-ok)]",children:"auto-fixable"})]})]}),(0,eT.jsx)(lM,{issue:oH(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}function di({lint:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)("file"),[a,s]=(0,eP.useState)(null),o=(0,eP.useMemo)(()=>e.messages.filter(e=>(!a||e.ruleId===a)&&("all"===t||("fixable"===t?e.fixable:e.severity===t))),[e.messages,t,a]),l=(0,eP.useMemo)(()=>{let e=new Map;for(let t of o){let n="file"===r?t.filePath:t.ruleId??"(no rule)",i=e.get(n)??[];i.push(t),e.set(n,i)}return[...e.entries()].sort((e,t)=>t[1].length-e[1].length)},[o,r]),d=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.messages){let e=n.ruleId??"(no rule)";t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.messages]);return e.unavailable?(0,eT.jsxs)(s8,{className:"p-6 text-sm text-muted-foreground",children:["ESLint could not run. ",e.note]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Breakdown",children:[(0,eT.jsx)(o$,{segments:[{label:"Errors",value:e.errorCount,color:"var(--sev-critical)"},{label:"Warnings",value:e.warningCount,color:"var(--sev-medium)"}]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:[(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.fixableCount})," of"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.messages.length})," auto-fixable"]})]}),(0,eT.jsx)(oS,{title:"Rules",action:a?(0,eT.jsxs)("button",{type:"button",onClick:()=>s(null),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground hover:text-foreground",children:["clear ",(0,eT.jsx)(sz,{className:"size-3"})]}):void 0,children:(0,eT.jsx)(oI,{rows:d,activeKey:a,onSelect:e=>s(t=>t===e?null:e)})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)(dn,{active:"all"===t,onClick:()=>n("all"),count:e.messages.length,children:"All"}),(0,eT.jsx)(dn,{active:"error"===t,onClick:()=>n("error"),count:e.errorCount,children:"Errors"}),(0,eT.jsx)(dn,{active:"warning"===t,onClick:()=>n("warning"),count:e.warningCount,children:"Warnings"}),(0,eT.jsx)(dn,{active:"fixable"===t,onClick:()=>n("fixable"),count:e.fixableCount,children:"Auto-fixable"})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)("span",{className:"px-2 font-mono text-[10px] uppercase text-muted-foreground",children:"Group"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i("file"),className:`rounded-sm px-2.5 py-1.5 text-sm transition-colors ${"file"===r?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"File"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i("rule"),className:`rounded-sm px-2.5 py-1.5 text-sm transition-colors ${"rule"===r?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Rule"})]})]}),a&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 rounded-sm border border-border bg-secondary/30 px-3 py-2 text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Filtered by rule"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:a}),(0,eT.jsxs)("button",{type:"button",onClick:()=>s(null),className:"ml-auto inline-flex items-center gap-1 text-muted-foreground hover:text-foreground",children:["clear ",(0,eT.jsx)(sz,{className:"size-3"})]})]}),0===l.length?(0,eT.jsx)(s8,{className:"p-8 text-center text-sm text-muted-foreground",children:"No matching issues."}):l.map(([e,t])=>{let n="rule"===r?oV(t[0].severity):null;return(0,eT.jsxs)(s8,{className:"gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-secondary/30 px-4 py-2.5",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[n&&(0,eT.jsx)("span",{className:`size-2 shrink-0 rounded-full ${n.dot}`,"aria-hidden":!0}),"file"===r?(0,eT.jsx)(lR,{path:e,className:"truncate text-sm"}):(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:e})]}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:t.length})]}),(0,eT.jsx)("div",{children:t.map((e,t)=>(0,eT.jsx)(dr,{msg:e,showFile:"rule"===r},`${e.filePath}-${e.line}-${e.column}-${t}`))})]},e)})]})]})}let da=eL("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ds=eL("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),dl=eL("brackets",[["path",{d:"M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3",key:"1kt8lf"}],["path",{d:"M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3",key:"gduv9"}]]),dd=eL("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]),dc=eL("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),du=eL("square-function",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]]),dm=eL("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),dp=eL("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),df={interface:{label:"interface",icon:eF,color:"var(--chart-1)"},type:{label:"type",icon:dl,color:"var(--chart-2)"},enum:{label:"enum",icon:dd,color:"var(--chart-3)"},class:{label:"class",icon:dc,color:"var(--chart-4)"},function:{label:"function",icon:du,color:"var(--chart-5)"}};function dh({m:e}){return(0,eT.jsxs)("div",{className:"flex items-baseline gap-2 border-t border-border py-2 font-mono text-xs first:border-t-0",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[e.readonly&&(0,eT.jsx)(dm,{className:"size-3 text-muted-foreground","aria-label":"readonly"}),e.name,e.optional&&(0,eT.jsx)("span",{className:"text-muted-foreground",children:"?"})]}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:":"}),(0,eT.jsx)("span",{className:"text-[color:var(--chart-2)]",children:e.type}),e.doc&&(0,eT.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:e.doc})]})}function dg({def:e,onSelectName:t}){let n=df[e.kind];return(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(n.icon,{className:"size-4",style:{color:n.color}}),(0,eT.jsx)("span",{className:"font-mono text-sm font-semibold text-foreground",children:e.name})]}),e.generics&&e.generics.length>0&&(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:`<${e.generics.join(", ")}>`}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-[10px] uppercase",children:n.label}),e.exported?(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:"exported"}):(0,eT.jsx)(nS,{variant:"outline",className:"font-mono text-[10px] uppercase text-muted-foreground",children:"local"})]}),e.doc&&(0,eT.jsx)("p",{className:"mt-2 text-pretty text-sm leading-relaxed text-muted-foreground",children:e.doc}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(dp,{className:"size-3"}),e.references," refs"]})]}),e.extendsFrom&&e.extendsFrom.length>0&&(0,eT.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"extends"}),e.extendsFrom.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>t(e),className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground hover:bg-secondary/70",children:[e,(0,eT.jsx)(oE,{className:"size-2.5"})]},e))]}),e.members.length>0&&(0,eT.jsxs)("div",{className:"mt-4",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["enum"===e.kind?"Members":"Properties"," (",e.members.length,")"]}),(0,eT.jsx)("div",{className:"mt-1",children:e.members.map(e=>(0,eT.jsx)(dh,{m:e},e.name))})]}),(0,eT.jsxs)("div",{className:"mt-4",children:[(0,eT.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Declaration"}),(0,eT.jsx)("pre",{className:"mt-1 overflow-x-auto rounded-sm border border-border bg-background p-3 font-mono text-xs leading-relaxed text-foreground",children:(0,eT.jsx)("code",{children:e.source})})]})]})}function dx({definitions:e}){let[t,n]=(0,eP.useState)(""),[r,i]=(0,eP.useState)("all"),[a,s]=(0,eP.useState)(e[0]?.id??""),o=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:df[e].label,count:t})).sort((e,t)=>t.count-e.count)},[e]),l=(0,eP.useMemo)(()=>{let n=t.trim().toLowerCase();return e.filter(e=>"all"===r||e.kind===r).filter(e=>!n||e.name.toLowerCase().includes(n)||e.filePath.toLowerCase().includes(n)).sort((e,t)=>t.references-e.references)},[e,r,t]),d=(0,eP.useMemo)(()=>e.find(e=>e.id===a)??l[0]??e[0],[e,a,l]),c=e.filter(e=>e.exported).length,u=[{key:"all",label:"All",count:e.length},...o.map(e=>({key:e.key,label:e.label,count:e.count}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[300px_1fr]",children:[(0,eT.jsxs)("aside",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)(oS,{title:"Type inventory",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"declared"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:c}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"exported"})]})]})}),(0,eT.jsx)(oS,{title:"By kind",children:(0,eT.jsx)(oI,{rows:o,activeKey:"all"===r?null:r,onSelect:e=>i(t=>t===e?"all":e)})}),(0,eT.jsxs)(s8,{className:"gap-0 p-3",children:[(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:t,onChange:e=>n(e.target.value),placeholder:"Filter types…",className:"w-full rounded-sm border border-border bg-background py-1.5 pl-8 pr-2 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-ring"})]}),(0,eT.jsx)("div",{className:"mt-3 flex flex-wrap gap-1",children:u.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("rounded-sm px-2 py-0.5 text-xs transition-colors",r===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label},e.key))}),(0,eT.jsx)("div",{className:"mt-3 flex max-h-[460px] flex-col overflow-y-auto",children:0===l.length?(0,eT.jsx)("p",{className:"py-6 text-center text-xs text-muted-foreground",children:"No types match."}):l.map(e=>{let t=df[e.kind],n=d?.id===e.id;return(0,eT.jsxs)("button",{type:"button",onClick:()=>s(e.id),className:(0,ny.cn)("flex items-center gap-2 rounded-sm border-t border-border px-2 py-2 text-left transition-colors first:border-t-0",n?"bg-secondary":"hover:bg-secondary/40"),children:[(0,eT.jsx)(t.icon,{className:"size-3.5 shrink-0",style:{color:t.color}}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:e.name}),!e.exported&&(0,eT.jsx)(dm,{className:"size-3 shrink-0 text-muted-foreground","aria-label":"local"}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:e.references})]},e.id)})})]})]}),(0,eT.jsx)("div",{className:"min-w-0",children:d?(0,eT.jsx)(dg,{def:d,onSelectName:function(t){let n=e.find(e=>e.name===t);n&&s(n.id)}}):(0,eT.jsx)(s8,{className:"p-6 text-sm text-muted-foreground",children:"Select a type to explore its shape."})})]})}function dv({diag:e}){let{viewIssue:t}=l$(),n=e.related.length>0;return(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oG(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oG(e)))},className:"flex w-full cursor-pointer items-start gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(si,{className:"size-3.5 shrink-0"}),(0,eT.jsx)(lR,{path:e.filePath,line:e.line,column:e.column}),(0,eT.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[n&&(0,eT.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(oT,{className:"size-3.5"}),e.related.length]}),(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-high)]/12 px-1.5 py-0.5 text-[color:var(--sev-high)]",children:e.code})]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.message})]}),(0,eT.jsx)(lM,{issue:oG(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}function dy({types:e}){let t=e.definitions??[],[n,r]=(0,eP.useState)("diagnostics");if(e.unavailable)return(0,eT.jsxs)(s8,{className:"p-6 text-sm text-muted-foreground",children:["TypeScript was not detected in this project. ",e.note]});let i=[{key:"diagnostics",label:"Diagnostics",icon:ds,count:e.diagnostics.length},{key:"explorer",label:"Type explorer",icon:eF,count:t.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:i.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.key),disabled:"explorer"===e.key&&0===t.length,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors disabled:opacity-40",n===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-4"}),e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"explorer"===n&&t.length>0?(0,eT.jsx)(dx,{definitions:t}):(0,eT.jsx)(db,{types:e})]})}function db({types:e}){let t=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.diagnostics)t.set(n.filePath,(t.get(n.filePath)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.diagnostics]),n=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.diagnostics)t.set(n.code,(t.get(n.code)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.diagnostics]);return 0===e.diagnostics.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(da,{className:"size-8 text-[color:var(--sev-ok)]"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No type errors"}),(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"tsc --noEmit passed cleanly."})]})]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Affected files",children:(0,eT.jsx)(oI,{rows:t})}),(0,eT.jsx)(oS,{title:"Error codes",children:(0,eT.jsx)(oI,{rows:n})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(0,eT.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:[e.diagnostics.length," type ",1===e.diagnostics.length?"error":"errors"," — click to expand the diagnostic chain"]}),e.diagnostics.map((e,t)=>(0,eT.jsx)(dv,{diag:e},`${e.filePath}-${e.line}-${t}`))]})]})}let dk=eL("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),dj=eL("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),dw=eL("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function dN({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsx)(s8,{className:(0,ny.cn)("gap-0 overflow-hidden border-l-2 py-0",n.border),children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oK(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oK(e)))},className:"flex w-full cursor-pointer items-start gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(eB,{className:(0,ny.cn)("mt-0.5 size-4 shrink-0",n.text)}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.category}),(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsxs)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:[Math.round(100*e.confidence),"% conf."]})]}),(0,eT.jsx)("p",{className:"mt-2 text-pretty text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-sm leading-relaxed text-muted-foreground",children:e.description})]}),(0,eT.jsx)(lM,{issue:oK(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}let d_=["critical","high","medium","low","info"];function dS({rescanning:e,onClick:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,disabled:e,className:"inline-flex items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-60",children:[e?(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"}):(0,eT.jsx)(dk,{className:"size-3.5"}),e?"Rescanning…":"Rescan security"]})}function d$({security:e}){let[t,n]=(0,eP.useState)("all"),{rescanning:r,error:i,rescan:a}=function(e){let[t,n]=(0,eP.useState)(!1),[r,i]=(0,eP.useState)(null),a=(0,eP.useRef)(e);return(0,eP.useEffect)(()=>{a.current!==e&&(a.current=e,n(!1))},[e]),(0,eP.useEffect)(()=>{if(!t)return;let e=window.setTimeout(()=>n(!1),12e4);return()=>window.clearTimeout(e)},[t]),{rescanning:t,error:r,rescan:(0,eP.useCallback)(async()=>{i(null),n(!0);try{let e=await fetch("/api/run?scope=security",{method:"POST"});if(!e.ok&&409!==e.status)throw Error(501===e.status?"Rescan needs the Projectlens CLI backend":`Rescan failed (${e.status})`)}catch(e){n(!1),i(e instanceof Error?e.message:"Rescan failed")}},[])}}(e),s=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),o=(0,eP.useMemo)(()=>"all"===t?s:s.filter(e=>e.severity===t),[s,t]),l=(0,eP.useMemo)(()=>{let t=[{key:"all",label:"All",count:e.findings.length}];for(let n of d_){let r=e.findings.filter(e=>e.severity===n).length;r>0&&t.push({key:n,label:oV(n).label,count:r})}return t},[e.findings]),d=["critical","high","medium","low","info"].map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})),c=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.category,(t.get(n.category)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),u=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.filePath,(t.get(n.filePath)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]);if(e.skipped)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(eB,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"AI security audit skipped"}),(0,eT.jsx)("p",{className:"max-w-sm text-pretty text-sm text-muted-foreground",children:"No AI key was configured. Set AI_GATEWAY_API_KEY to enable the code review and dependency prioritization."})]}),(0,eT.jsx)(dS,{rescanning:r,onClick:a}),i&&(0,eT.jsx)("p",{className:"font-mono text-xs text-[color:var(--sev-critical)]",children:i})]});let m=e.findings.filter(e=>"critical"===e.severity||"high"===e.severity).length,p=e.findings.length>0?Math.round(e.findings.reduce((e,t)=>e+t.confidence,0)/e.findings.length*100):0;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Posture",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.findings.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"code findings"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:m}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"critical + high"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:c.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"categories"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:[p,"%"]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"avg confidence"})]})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs leading-relaxed text-muted-foreground",children:["Dependency advisories now live in the"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Dependencies"})," tab."]})]}),(0,eT.jsx)(oS,{title:"By severity",children:(0,eT.jsx)(o$,{segments:d})}),(0,eT.jsx)(oS,{title:"By category",children:(0,eT.jsx)(oI,{rows:c,emptyLabel:"No findings."})}),(0,eT.jsx)(oS,{title:"Affected files",children:(0,eT.jsx)(oI,{rows:u,emptyLabel:"No findings."})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(e.failed||i)&&(0,eT.jsxs)(s8,{className:"flex items-start gap-3 border-l-2 border-l-[color:var(--sev-high)] bg-[color:var(--sev-high)]/[0.06] p-4",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-4 shrink-0 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"AI security review error"}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-sm leading-relaxed text-muted-foreground",children:i??e.error??"The AI review failed. Results below may be incomplete."})]}),(0,eT.jsx)(dS,{rescanning:r,onClick:a})]}),e.findings.length>0&&(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:l.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eB,{className:"size-4 text-[color:var(--sev-high)]"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Code findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:o.length}),(0,eT.jsx)("span",{className:"ml-auto hidden font-mono text-xs text-muted-foreground sm:inline",children:"click a finding for full detail"}),!e.failed&&!i&&(0,eT.jsx)("div",{className:"ml-auto sm:ml-0",children:(0,eT.jsx)(dS,{rescanning:r,onClick:a})})]}),0===e.findings.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No code-level security issues found by the AI review."]}):0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No findings at this severity."]}):(0,eT.jsx)("div",{className:"flex flex-col gap-2",children:o.map(e=>(0,eT.jsx)(dN,{finding:e},e.id))})]})]})}let dI=eL("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);function dE(e){if(e.flagged&&e.severity)return`var(--chart-${dC(e.severity)})`;switch(e.type){case"direct":return"var(--chart-1)";case"dev":return"var(--chart-4)";default:return"var(--muted-foreground)"}}function dC(e){return({critical:1,high:2,medium:3,low:4,info:5})[e]??5}function dA({graph:e}){let[t,n]=(0,eP.useState)(null),[r,i]=(0,eP.useState)(null),[a,s]=(0,eP.useState)(null),o=(0,eP.useMemo)(()=>Math.max(...e.nodes.map(e=>e.depth)),[e.nodes]),{positioned:l,byId:d,width:c,height:u}=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.nodes){let e=t.get(n.depth)??[];e.push(n),t.set(n.depth,e)}let n=[],r=0;for(let e=0;e<=o;e++){let i=(t.get(e)??[]).sort((e,t)=>!!t.flagged!=!!e.flagged?t.flagged?1:-1:(t.sizeKb??0)-(e.sizeKb??0));r=Math.max(r,i.length),i.forEach((t,r)=>{n.push({...t,x:24+240*e,y:24+46*r})})}let i=new Map(n.map(e=>[e.id,e]));return{positioned:n,byId:i,width:48+240*o+176,height:48+46*r}},[e.nodes,o]),m=(0,eP.useMemo)(()=>{let e=[];for(let t of l)for(let n of t.dependencies){let r=d.get(n);r&&e.push({from:t,to:r})}return e},[l,d]),p=t??r,f=(0,eP.useMemo)(()=>{if(!p)return null;let e=d.get(p);return e?{deps:new Set(e.dependencies.filter(e=>d.has(e))),dependents:new Set(l.filter(e=>e.dependencies.includes(p)).map(e=>e.id))}:null},[p,d,l]),h=t?d.get(t):null,g=t?l.filter(e=>e.dependencies.includes(t)):[],x=e.nodes.filter(e=>"direct"===e.type).length,v=e.nodes.filter(e=>"dev"===e.type).length,y=e.nodes.filter(e=>e.flagged).length,b=e.nodes.reduce((e,t)=>e+(t.sizeKb??0),0);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)(s8,{className:"min-w-0 gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border p-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s9,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:"Module graph"})]}),(0,eT.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-1 rounded-sm border border-border bg-background p-0.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>s(null),className:(0,ny.cn)("rounded-sm px-2.5 py-1 text-xs transition-colors",null===a?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:"All depths"}),Array.from({length:o+1}).map((e,t)=>(0,eT.jsxs)("button",{type:"button",onClick:()=>s(e=>e===t?null:t),className:(0,ny.cn)("rounded-sm px-2.5 py-1 font-mono text-xs transition-colors",a===t?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:["L",t]},t))]})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[(0,eT.jsx)(dT,{color:"var(--chart-1)",label:"direct"}),(0,eT.jsx)(dT,{color:"var(--chart-4)",label:"dev"}),(0,eT.jsx)(dT,{color:"var(--muted-foreground)",label:"transitive"}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dw,{className:"size-3 text-[color:var(--sev-high)]"})," flagged"]}),(0,eT.jsx)("span",{className:"ml-auto hidden sm:inline",children:"Click a node to inspect its edges"})]}),(0,eT.jsx)("div",{className:"overflow-auto bg-[image:radial-gradient(var(--border)_1px,transparent_1px)] [background-size:16px_16px]",children:(0,eT.jsxs)("svg",{width:c,height:u,viewBox:`0 0 ${c} ${u}`,className:"min-w-full",role:"img","aria-label":"Dependency graph",children:[(0,eT.jsx)("g",{children:m.map((e,t)=>{let n=null!==a&&e.from.depth!==a&&e.to.depth!==a,r=e.from.x+176,i=e.from.y+15,s=e.to.x,o=e.to.y+15,l=(r+s)/2,d=!!p&&(e.from.id===p||e.to.id===p);return(0,eT.jsx)("path",{d:`M ${r} ${i} C ${l} ${i}, ${l} ${o}, ${s} ${o}`,fill:"none",stroke:d?"var(--chart-1)":"var(--border)",strokeWidth:d?1.6:1,opacity:n?.15:p&&!d?.25:.7},t)})}),(0,eT.jsx)("g",{children:l.map(e=>{var t;let r=(t=e.id,p?t===p?"active":f?.deps.has(t)||f?.dependents.has(t)?"linked":"dim":"normal"),s=null!==a&&e.depth!==a,o=dE(e);return(0,eT.jsxs)("g",{transform:`translate(${e.x}, ${e.y})`,opacity:s?.2:"dim"===r?.3:1,className:"cursor-pointer",onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null),onClick:()=>n(t=>t===e.id?null:e.id),children:[(0,eT.jsx)("rect",{width:176,height:30,rx:4,fill:"var(--card)",stroke:"active"===r?o:"var(--border)",strokeWidth:"active"===r?2:1}),(0,eT.jsx)("rect",{width:4,height:30,rx:2,fill:o}),(0,eT.jsx)("text",{x:14,y:15,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:11,children:e.id.length>18?e.id.slice(0,17)+"…":e.id}),e.flagged&&(0,eT.jsx)("circle",{cx:164,cy:15,r:3,fill:`var(--chart-${dC(e.severity??"info")})`})]},e.id)})})]})})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsx)("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Graph stats"}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsx)(dP,{icon:eq,value:e.nodes.length,label:"modules"}),(0,eT.jsx)(dP,{icon:te,value:x,label:"direct"}),(0,eT.jsx)(dP,{icon:s4,value:v,label:"dev"}),(0,eT.jsx)(dP,{icon:dw,value:y,label:"flagged"})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:["install size ≈ ",(0,eT.jsxs)("span",{className:"font-mono text-foreground",children:[(b/1024).toFixed(1)," MB"]})," ·"," ",o+1," levels deep"]})]}),h?(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"size-2.5 rounded-full",style:{background:dE(h)},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:h.id})]}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.version}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.type}),(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:["depth ",h.depth]}),null!=h.sizeKb&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.sizeKb>=1024?`${(h.sizeKb/1024).toFixed(1)} MB`:`${h.sizeKb} KB`})]}),h.flagged&&h.severity&&(0,eT.jsx)("div",{className:"mt-3",children:(0,eT.jsxs)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",oV(h.severity).bg,oV(h.severity).text),children:["has ",oV(h.severity).label," finding"]})}),(0,eT.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Depends on (",h.dependencies.length,")"]}),0===h.dependencies.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"No further dependencies (leaf)."}):(0,eT.jsx)("div",{className:"flex flex-wrap gap-1",children:h.dependencies.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>d.has(e)&&n(e),className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px]",d.has(e)?"bg-secondary text-foreground hover:bg-secondary/70":"bg-secondary/40 text-muted-foreground"),children:e},e))})]}),(0,eT.jsxs)("div",{className:"mt-3 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Required by (",g.length,")"]}),0===g.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"Root-level / not required by another module."}):(0,eT.jsx)("div",{className:"flex flex-wrap gap-1",children:g.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>n(e.id),className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground hover:bg-secondary/70",children:e.id},e.id))})]})]}):(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-4 text-sm text-muted-foreground",children:[(0,eT.jsx)(eq,{className:"size-5 text-muted-foreground"}),(0,eT.jsx)("p",{className:"text-pretty",children:"Select a module in the graph to trace what it depends on and which packages require it."})]})]})]})}function dT({color:e,label:t}){return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"size-2.5 rounded-full",style:{background:e},"aria-hidden":!0}),t]})}function dP({icon:e,value:t,label:n}){return(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(e,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:t})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n})]})}let dz={vulnerability:"Vulnerable",outdated:"Outdated",deprecated:"Deprecated",unused:"Unused",missing:"Missing",license:"License"};function dO({dep:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oJ(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oJ(e)))},className:"flex w-full cursor-pointer flex-col gap-2 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40 sm:flex-row sm:items-start sm:gap-4",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)(eq,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.current}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dz[e.kind]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.type})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[e.cves?.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:e},e)),e.license&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:e.license}),e.usedIn&&e.usedIn.length>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:["used in ",(0,eT.jsx)(lR,{path:e.usedIn[0]})]})]})]}),(0,eT.jsx)(lM,{issue:oJ(e),variant:"dot",className:"mt-0.5"})]}),e.fixedIn&&(0,eT.jsxs)("div",{className:"inline-flex shrink-0 items-center gap-1 rounded-sm border border-[color:var(--sev-ok)]/40 bg-[color:var(--sev-ok)]/10 px-2.5 py-1 font-mono text-xs text-[color:var(--sev-ok)]",children:[e.current," ",(0,eT.jsx)(s2,{className:"size-3"})," ",e.fixedIn]})]})}function dM({deps:e}){let[t,n]=(0,eP.useState)("findings"),r=[{key:"findings",label:"Findings",icon:oT,count:e.findings.length},{key:"graph",label:"Dependency graph",icon:dI,count:e.graph?.nodes.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:r.map(r=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(r.key),disabled:"graph"===r.key&&!e.graph,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors disabled:opacity-40",t===r.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(r.icon,{className:"size-4"}),r.label,null!=r.count&&(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:r.count})]},r.key))}),"graph"===t&&e.graph?(0,eT.jsx)(dA,{graph:e.graph}):(0,eT.jsx)(dR,{deps:e})]})}function dR({deps:e}){let[t,n]=(0,eP.useState)("all"),r=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),i=(0,eP.useMemo)(()=>"all"===t?r:r.filter(e=>e.kind===t),[r,t]),a=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:dz[e],count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.type,(t.get(n.type)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),o=["critical","high","medium","low","info"].map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})),l=e.findings.filter(e=>e.fixedIn).length,d=e.findings.filter(e=>"vulnerability"===e.kind).length,c=[{key:"all",label:"All",count:e.findings.length},...a.map(e=>({key:e.key,label:e.label,count:e.count}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Inventory",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total deps"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.direct}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"direct"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.dev}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"dev"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:l}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"upgradable"})]})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:[(0,eT.jsx)("span",{className:"font-mono text-foreground",children:d})," with known advisories ·"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.transitive})," transitive"]})]}),(0,eT.jsx)(oS,{title:"By severity",children:(0,eT.jsx)(o$,{segments:o})}),(0,eT.jsx)(oS,{title:"By issue type",children:(0,eT.jsx)(oI,{rows:a,activeKey:"all"===t?null:t,onSelect:e=>n(t=>t===e?"all":e)})}),(0,eT.jsx)(oS,{title:"By dependency type",children:(0,eT.jsx)(oI,{rows:s})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:c.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(te,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Dependency findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:i.length}),(0,eT.jsxs)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:["from ",(0,eT.jsx)(lR,{path:e.manifestPath})]})]}),0===i.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No dependency issues in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:i.map(e=>(0,eT.jsx)(dO,{dep:e},e.id))})]})]})}let dD=eL("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]),dL=eL("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),dU=eL("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),dZ=eL("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]),dF=eL("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),dB=eL("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),dV=eL("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),dq={postgres:"PostgreSQL",mysql:"MySQL",mongodb:"MongoDB",sqlite:"SQLite",redis:"Redis",other:"Other"};function dW({tables:e,connections:t}){let[n,r]=(0,eP.useState)(null),[i,a]=(0,eP.useState)(null),s=(0,eP.useMemo)(()=>{let n=new Map;for(let r of e){let e=t.find(e=>e.id===r.connectionId);n.set(r.name,e?.engine??"other")}return n},[e,t]),o=(0,eP.useMemo)(()=>{let t=new Set(e.map(e=>e.name)),n=[];for(let r of e)for(let e of r.columns){if(!e.references)continue;let i=function(e){let t=e.lastIndexOf(".");return t<=0?null:{table:e.slice(0,t),column:e.slice(t+1)}}(e.references);i&&t.has(i.table)&&i.table!==r.name&&n.push({id:`${r.name}.${e.name}->${i.table}`,from:r.name,to:i.table,fromColumn:e.name,toColumn:i.column})}return n},[e]),{positioned:l,byName:d,width:c,height:u}=(0,eP.useMemo)(()=>{let t=new Set;for(let e of o)t.add(e.from),t.add(e.to);let n=[...e].sort((e,n)=>{let r=+!t.has(e.name),i=+!t.has(n.name);return r!==i?r-i:n.columns.length-e.columns.length}),r=Math.max(1,Math.ceil(Math.sqrt(n.length))),i=e=>34+22*Math.min(e.columns.length,7),a=Math.max(56,...n.map(i))+48,s=n.map((e,t)=>{let n=Math.floor(t/r),s=e.columns.slice(0,7);return{table:e,rows:s,x:28+t%r*280,y:28+n*a,w:210,h:i(e)}}),l=new Map(s.map(e=>[e.table.name,e])),d=Math.ceil(n.length/r);return{positioned:s,byName:l,width:56+280*r-70,height:56+d*a-48}},[e,o]),m=n??i,p=(0,eP.useMemo)(()=>{if(!m)return null;let e=new Set([m]);for(let t of o)t.from===m&&e.add(t.to),t.to===m&&e.add(t.from);return e},[m,o]),f=n?d.get(n)?.table:null,h=n?o.filter(e=>e.from===n):[],g=n?o.filter(e=>e.to===n):[];return 0===e.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5"}),"No schema discovered, so there are no relationships to map yet."]}):0===o.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5"}),(0,eT.jsxs)("p",{className:"text-pretty",children:[e.length," ",1===e.length?"table was":"tables were"," found, but no foreign-key relationships were detected between them. Add explicit references in your schema (e.g. Drizzle"," ",(0,eT.jsx)("span",{className:"font-mono",children:"references()"})," or Prisma ",(0,eT.jsx)("span",{className:"font-mono",children:"@relation"}),") to see an ER map here."]})]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)(s8,{className:"min-w-0 gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dU,{className:"size-3 text-[color:var(--sev-ok)]"})," primary key"]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"})," foreign key"]}),(0,eT.jsx)("span",{className:"ml-auto hidden sm:inline",children:"Click a table to trace its relationships"})]}),(0,eT.jsx)("div",{className:"overflow-auto bg-[image:radial-gradient(var(--border)_1px,transparent_1px)] [background-size:16px_16px]",children:(0,eT.jsxs)("svg",{width:c,height:u,viewBox:`0 0 ${c} ${u}`,className:"min-w-full",role:"img","aria-label":"Database relationship diagram",children:[(0,eT.jsx)("g",{children:o.map(e=>{let t=function(e){let t=d.get(e.from),n=d.get(e.to);if(!t||!n)return null;let r=t.x+t.w/2,i=n.x+n.w/2,a=t.rows.findIndex(t=>t.name===e.fromColumn),s=a>=0?t.y+34+22*a+11:t.y+t.h/2,o=n.y+17,l=i>=r,c=l?t.x+t.w:t.x,u=i>=r?n.x:n.x+n.w,p=.5*Math.abs(u-c)||30;return{d:`M ${c} ${s} C ${l?c+p:c-p} ${s}, ${l?u-p:u+p} ${o}, ${u} ${o}`,activeEdge:m===e.from||m===e.to}}(e);if(!t)return null;let n=m&&!t.activeEdge;return(0,eT.jsx)("path",{d:t.d,fill:"none",stroke:t.activeEdge?"var(--chart-1)":"var(--muted-foreground)",strokeWidth:t.activeEdge?1.8:1,opacity:n?.15:.55,markerEnd:t.activeEdge?"url(#er-arrow-active)":"url(#er-arrow)"},e.id)})}),(0,eT.jsxs)("defs",{children:[(0,eT.jsx)("marker",{id:"er-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:(0,eT.jsx)("path",{d:"M0,0 L6,3 L0,6 Z",fill:"var(--muted-foreground)"})}),(0,eT.jsx)("marker",{id:"er-arrow-active",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:(0,eT.jsx)("path",{d:"M0,0 L6,3 L0,6 Z",fill:"var(--chart-1)"})})]}),(0,eT.jsx)("g",{children:l.map(e=>{var t;let n=(t=e.table.name,!!(m&&p&&!p.has(t))),i=m===e.table.name,o=s.get(e.table.name)??"other",l=e.table.columns.length-e.rows.length;return(0,eT.jsxs)("g",{transform:`translate(${e.x}, ${e.y})`,opacity:n?.3:1,className:"cursor-pointer",onMouseEnter:()=>a(e.table.name),onMouseLeave:()=>a(null),onClick:()=>r(t=>t===e.table.name?null:e.table.name),children:[(0,eT.jsx)("rect",{width:e.w,height:e.h,rx:6,fill:"var(--card)",stroke:i?"var(--chart-1)":"var(--border)",strokeWidth:i?2:1}),(0,eT.jsx)("rect",{width:e.w,height:34,rx:6,fill:"var(--secondary)"}),(0,eT.jsx)("rect",{y:28,width:e.w,height:6,fill:"var(--secondary)"}),(0,eT.jsx)("text",{x:12,y:17,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:12,fontWeight:600,children:e.table.name.length>22?e.table.name.slice(0,21)+"…":e.table.name}),(0,eT.jsx)("text",{x:e.w-10,y:17,textAnchor:"end",dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:8,children:dq[o].toUpperCase()}),e.rows.map((t,n)=>{let r=t.flags.includes("pk"),i=t.flags.includes("fk")||!!t.references;return(0,eT.jsxs)("g",{transform:`translate(0, ${34+22*n})`,children:[n>0&&(0,eT.jsx)("line",{x1:0,y1:0,x2:e.w,y2:0,stroke:"var(--border)",strokeWidth:.5,opacity:.5}),r&&(0,eT.jsx)("circle",{cx:12,cy:11,r:3,fill:"var(--sev-ok)"}),!r&&i&&(0,eT.jsx)("circle",{cx:12,cy:11,r:3,fill:"var(--chart-1)"}),!r&&!i&&(0,eT.jsx)("circle",{cx:12,cy:11,r:2,fill:"var(--muted-foreground)",opacity:.4}),(0,eT.jsx)("text",{x:24,y:11,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:10,children:t.name.length>16?t.name.slice(0,15)+"…":t.name}),(0,eT.jsx)("text",{x:e.w-10,y:11,textAnchor:"end",dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:9,children:t.type.length>12?t.type.slice(0,11)+"…":t.type})]},t.name)}),l>0&&(0,eT.jsx)("text",{x:24,y:34+22*e.rows.length-11+22,dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:9,children:`+${l} more`})]},e.table.name)})})]})})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsx)("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Schema map"}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dV,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:e.length})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"tables"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dp,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:o.length})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"relationships"})]})]})]}),f?(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dV,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:f.name})]}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:f.kind}),(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:[f.columns.length," cols"]}),f.rowCount>0&&(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:[f.rowCount.toLocaleString()," rows"]})]}),(0,eT.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["References (",h.length,")"]}),0===h.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"This table has no outgoing foreign keys."}):(0,eT.jsx)("div",{className:"flex flex-col gap-1",children:h.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.to),className:"flex items-center gap-1.5 rounded-sm bg-secondary/60 px-2 py-1 text-left font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.fromColumn}),(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"}),(0,eT.jsx)("span",{children:e.to}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:[".",e.toColumn]})]},e.id))})]}),(0,eT.jsxs)("div",{className:"mt-3 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Referenced by (",g.length,")"]}),0===g.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"No other table references this one."}):(0,eT.jsx)("div",{className:"flex flex-col gap-1",children:g.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.from),className:"flex items-center gap-1.5 rounded-sm bg-secondary/60 px-2 py-1 text-left font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{children:e.from}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:[".",e.fromColumn]}),(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.toColumn})]},e.id))})]}),f.filePath&&(0,eT.jsx)("div",{className:"mt-3 border-t border-border pt-3 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:f.filePath})})]}):(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-4 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5 text-muted-foreground"}),(0,eT.jsx)("p",{className:"text-pretty",children:"Select a table in the diagram to trace what it references and which tables point back to it."})]})]})]})}let dH={"n+1":"N+1 query","missing-index":"Missing index","no-pooling":"No pooling",injection:"Injection",unparameterized:"Unparameterized","schema-drift":"Schema drift","no-migration":"No migration","unbounded-query":"Unbounded query","no-ssl":"No SSL","connection-leak":"Connection leak","missing-ttl":"Missing TTL","full-scan":"Full scan","no-validation":"No validation"},dG={postgres:"PostgreSQL",mysql:"MySQL",mongodb:"MongoDB",sqlite:"SQLite",redis:"Redis",other:"Other"},dK={dependency:"Dependency",env:"Env var","connection-string":"Connection string","schema-file":"Schema file",config:"Config"};function dJ({engine:e}){return(0,eT.jsx)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dG[e]})}function dY({active:e,onClick:t,icon:n,label:r,count:i}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[n,r,null!=i&&(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:i})]})}function dX({conn:e}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border px-3 py-2.5 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eW,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.name}),(0,eT.jsx)(dJ,{engine:e.engine})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 pl-6 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"truncate",children:e.client}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[e.ssl?(0,eT.jsx)(dm,{className:"size-3 text-[color:var(--sev-ok)]"}):(0,eT.jsx)(dD,{className:"size-3 text-[color:var(--sev-high)]"}),e.ssl?"TLS":"no TLS"]}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.pooled?"text-muted-foreground":"text-[color:var(--sev-medium)]"),children:e.pooled?"pooled":"unpooled"})]})]})}function dQ({label:e,value:t,mono:n=!0}){return(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-3 py-1.5",children:[(0,eT.jsx)("span",{className:"shrink-0 text-[11px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)("min-w-0 truncate text-right text-xs text-foreground",n&&"font-mono"),children:t})]})}function d0({conn:e}){return(0,eT.jsxs)(s8,{className:"gap-0 p-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border p-4",children:[(0,eT.jsx)("span",{className:"inline-flex size-8 shrink-0 items-center justify-center rounded-sm bg-secondary",children:(0,eT.jsx)(eW,{className:"size-4 text-foreground"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)(dJ,{engine:e.engine})]}),(0,eT.jsx)("p",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e.client})]}),(0,eT.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:e.ssl?(0,eT.jsxs)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(dm,{className:"mr-1 size-3"}),"TLS"]}):(0,eT.jsxs)(nS,{className:"border-0 bg-[color:var(--sev-high)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:[(0,eT.jsx)(dD,{className:"mr-1 size-3"}),"No TLS"]})})]}),(0,eT.jsxs)("div",{className:"flex flex-col px-4 py-2",children:[(0,eT.jsx)(dQ,{label:"Host",value:e.host}),e.scheme&&(0,eT.jsx)(dQ,{label:"Scheme",value:e.scheme}),e.envVar&&(0,eT.jsx)(dQ,{label:"Env var",value:e.envVar}),(0,eT.jsx)(dQ,{label:"Detected via",value:e.detectedVia?dK[e.detectedVia]:"—",mono:!1}),e.schemaSource&&(0,eT.jsx)(dQ,{label:"Schema",value:e.schemaSource,mono:!1}),(0,eT.jsx)(dQ,{label:"Pooling",value:e.pooled?"Pooled":"Direct / unpooled",mono:!1}),(0,eT.jsx)(dQ,{label:"mongodb"===e.engine?"Collections":"Tables",value:e.collections.toLocaleString()})]}),(0,eT.jsx)("div",{className:"border-t border-border px-4 py-2 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath})})]})}function d1({f:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsx)("div",{role:"button",tabIndex:0,onClick:()=>t(o0(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o0(e)))},className:"flex w-full cursor-pointer flex-col gap-2 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)(eW,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)(dJ,{engine:e.engine}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dH[e.kind]}),e.target&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.target})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsx)("div",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsx)(lM,{issue:o0(e),variant:"dot",className:"mt-0.5"})]})})}function d2({flags:e}){return(0,eT.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1",children:[e.includes("pk")&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(dU,{className:"size-3"}),"PK"]}),e.includes("fk")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Link"}),e.includes("unique")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Unique"}),e.includes("index")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Index"}),e.includes("nullable")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Nullable"}),e.includes("default")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Default"})]})}function d4({table:e,expanded:t,onToggle:n}){return(0,eT.jsxs)("div",{className:"border-t border-border first:border-t-0",children:[(0,eT.jsx)("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},className:"flex w-full cursor-pointer items-center justify-between gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)("div",{className:"mt-0.5 inline-flex size-4 shrink-0 items-center justify-center",children:(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind})]}),(0,eT.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{children:[e.columns.length," columns"]}),e.rowCount>0&&(0,eT.jsxs)("span",{children:[e.rowCount.toLocaleString()," rows"]}),e.sizeKb?(0,eT.jsxs)("span",{children:[(e.sizeKb/1024).toFixed(1)," MB"]}):null,e.indexes.length>0&&(0,eT.jsxs)("span",{children:[e.indexes.length," indexes"]})]})]})]})}),t&&(0,eT.jsxs)("div",{className:"border-t border-border/50 bg-secondary/20 p-4",children:[(0,eT.jsx)("div",{className:"flex flex-col gap-3",children:e.columns.map(e=>(0,eT.jsx)("div",{className:"flex items-start justify-between gap-2 font-mono text-xs",children:(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"text-muted-foreground/70",children:e.type}),e.references&&(0,eT.jsx)("span",{className:"text-muted-foreground/70",children:`→ ${e.references}`})]}),(0,eT.jsx)(d2,{flags:e.flags})]})},e.name))}),e.indexes.length>0&&(0,eT.jsxs)("div",{className:"mt-4 border-t border-border/50 pt-3",children:[(0,eT.jsx)("p",{className:"mb-2 font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:"Indexes"}),(0,eT.jsx)("div",{className:"flex flex-col gap-1.5",children:e.indexes.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[(0,eT.jsx)(dd,{className:"size-3 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-foreground",children:e.name}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:["(",e.columns.join(", "),")"]}),e.unique&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"unique"})]},e.name))})]}),e.filePath&&(0,eT.jsx)("div",{className:"mt-3 border-t border-border/50 pt-3 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath})})]})]})}function d5({q:e}){let t=e.estMs>=1500?"var(--sev-critical)":e.estMs>=1e3?"var(--sev-high)":e.estMs>=300?"var(--sev-medium)":"var(--sev-ok)";return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsx)("span",{className:"w-16 shrink-0 font-mono text-[11px] uppercase text-muted-foreground",children:e.operation}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.target}),(0,eT.jsx)(dJ,{engine:e.engine}),e.fullScan&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-high)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:[(0,eT.jsx)(dw,{className:"size-3"})," scan"]})]}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-1 text-[11px] text-muted-foreground",children:e.note}),(0,eT.jsx)("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 font-mono text-xs tabular-nums",style:{color:t},children:[(0,eT.jsx)(dL,{className:"size-3"}),e.estMs>=1e3?`${(e.estMs/1e3).toFixed(1)}s`:`${e.estMs}ms`]})]})}let d6=["critical","high","medium","low","info"];function d3({database:e}){let t=e.tables??[],n=e.connections.length>0,[r,i]=(0,eP.useState)(n?"connections":"findings"),[a,s]=(0,eP.useState)("all"),[o,l]=(0,eP.useState)(new Set),d=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),c=(0,eP.useMemo)(()=>"all"===a?d:d.filter(e=>e.severity===a),[d,a]),u=(0,eP.useMemo)(()=>[...e.queries].sort((e,t)=>t.estMs-e.estMs),[e.queries]),m=(0,eP.useMemo)(()=>[...new Set(e.connections.map(e=>e.engine))].map((t,n)=>({label:dG[t],value:Math.max(1,e.connections.filter(e=>e.engine===t).length),color:`var(--chart-${n%5+1})`})),[e.connections]),p=d6.map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})).filter(e=>e.value>0),f=[{key:"all",label:"All",count:d.length},...d6.map(e=>({key:e,label:oV(e).label,count:d.filter(t=>t.severity===e).length})).filter(e=>e.count>0)],h=(0,eP.useMemo)(()=>{let e=new Set(t.map(e=>e.name)),n=0;for(let r of t)for(let t of r.columns){if(!t.references)continue;let i=t.references.lastIndexOf("."),a=i>0?t.references.slice(0,i):"";a&&a!==r.name&&e.has(a)&&n++}return n},[t]),g=(0,eP.useMemo)(()=>{let e=new Map;for(let n of t){let t=e.get(n.connectionId)??[];t.push(n),e.set(n.connectionId,t)}return e},[t]);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Datastores",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3 pb-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.connections}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"connections"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.collections}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"tables / collections"})]})]}),(0,eT.jsxs)("div",{className:"-mx-3 border-t border-border",children:[e.connections.map(e=>(0,eT.jsx)(dX,{conn:e},e.id)),!n&&(0,eT.jsx)("p",{className:"px-3 py-3 text-[11px] text-muted-foreground",children:"No datastore detected."})]})]}),m.length>0&&(0,eT.jsx)(oS,{title:"By engine",children:(0,eT.jsx)(o$,{segments:m})}),p.length>0&&(0,eT.jsx)(oS,{title:"Findings by severity",children:(0,eT.jsx)(o$,{segments:p})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)(dY,{active:"connections"===r,onClick:()=>i("connections"),icon:(0,eT.jsx)(dZ,{className:"size-4"}),label:"Connections",count:e.connections.length}),(0,eT.jsx)(dY,{active:"schema"===r,onClick:()=>i("schema"),icon:(0,eT.jsx)(s9,{className:"size-4"}),label:"Schema",count:t.length}),(0,eT.jsx)(dY,{active:"relationships"===r,onClick:()=>i("relationships"),icon:(0,eT.jsx)(dB,{className:"size-4"}),label:"Relationships",count:h}),(0,eT.jsx)(dY,{active:"queries"===r,onClick:()=>i("queries"),icon:(0,eT.jsx)(e0,{className:"size-4"}),label:"Queries",count:e.queries.length}),(0,eT.jsx)(dY,{active:"findings"===r,onClick:()=>i("findings"),icon:(0,eT.jsx)(dw,{className:"size-4"}),label:"Findings",count:e.findings.length})]}),"connections"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dF,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Detected datastores"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.connections.length})]}),n?(0,eT.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:e.connections.map(e=>(0,eT.jsx)(d0,{conn:e},e.id))}):(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-5"}),"No database connection detected. Add a connection string (e.g. DATABASE_URL or MONGODB_URI) or a database client dependency."]})]}),"schema"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s9,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Schema explorer"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[t.length," ",1===t.length?"table":"tables"]})]}),0===t.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(lH,{className:"size-5"}),"No schema discovered. Add a Prisma/Drizzle schema, Mongoose models, or provide a reachable connection string for live introspection."]}):(0,eT.jsx)("div",{className:"flex flex-col gap-4",children:[...g.entries()].map(([t,n])=>{let r=e.connections.find(e=>e.id===t);return(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[r&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)(te,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xs text-foreground",children:r.name}),(0,eT.jsx)(dJ,{engine:r.engine}),(0,eT.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[n.length," ","mongodb"===r.engine?"collections":"tables"]})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:n.map(e=>(0,eT.jsx)(d4,{table:e,expanded:o.has(`${t}:${e.name}`),onToggle:()=>{var n;return n=`${t}:${e.name}`,void l(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})}},`${t}:${e.name}`))})]},t)})})]}),"relationships"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dB,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Relationship map"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[h," ",1===h?"relation":"relations"]})]}),(0,eT.jsx)(dW,{tables:t,connections:e.connections})]}),"queries"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e0,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Slowest queries"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.counts.slowQueries," slow"]})]}),0===u.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No notable or slow queries detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:u.map(e=>(0,eT.jsx)(d5,{q:e},e.id))})]}),"findings"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:f.map(e=>(0,eT.jsx)(dY,{active:a===e.key,onClick:()=>s(e.key),label:e.label,count:e.count},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eW,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Database findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:c.length})]}),0===c.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No database issues in this severity."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:c.map(e=>(0,eT.jsx)(d1,{f:e},e.id))})]})]})]})}let d9=eL("circle-slash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);function d8(e){switch(e){case"GET":case"HEAD":case"OPTIONS":default:return{text:"text-muted-foreground",bg:"bg-secondary",border:"border-border"};case"POST":return{text:"text-primary-foreground",bg:"bg-primary",border:"border-primary"};case"PUT":case"PATCH":return{text:"text-foreground",bg:"bg-accent",border:"border-foreground/40"};case"DELETE":return{text:"text-foreground",bg:"bg-background",border:"border-foreground/60"}}}let d7=["POST","PUT","PATCH","DELETE"];function ce({api:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)(""),a=(0,eP.useMemo)(()=>[...e.endpoints].sort((e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)),[e.endpoints]),s=(0,eP.useMemo)(()=>{let e=a;"mutations"===t?e=e.filter(e=>d7.includes(e.method)):"public"===t?e=e.filter(e=>!e.flags.auth&&d7.includes(e.method)):"issues"===t&&(e=e.filter(e=>e.findings.length>0));let n=r.trim().toLowerCase();return n&&(e=e.filter(e=>e.path.toLowerCase().includes(n)||e.method.toLowerCase().includes(n))),e},[a,t,r]),o=(0,eP.useMemo)(()=>{let e=new Map;for(let t of s){let n=t.path.replace(/^\//,"").split("/")[0]||"(root)";e.has(n)||e.set(n,[]),e.get(n).push(t)}return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[s]);if(!e.present)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(dB,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No API endpoints detected"}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:"Projectlens maps route handlers and server actions across Next.js, Express, Hono, Fastify, SvelteKit and Nuxt. Add a server route to see your API surface here."})]})]});let l=[{key:"all",label:"All",count:e.counts.endpoints},{key:"mutations",label:"Mutations",count:e.counts.mutations},{key:"public",label:"Public mutations",count:e.endpoints.filter(e=>!e.flags.auth&&d7.includes(e.method)).length},{key:"issues",label:"With issues",count:e.endpoints.filter(e=>e.findings.length>0).length}],d=e.counts.endpoints>0?Math.round(e.counts.protected/e.counts.endpoints*100):0,c=e.counts.endpoints>0?Math.round(e.counts.validated/e.counts.endpoints*100):0;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:l.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsx)("input",{type:"search",value:r,onChange:e=>i(e.target.value),placeholder:"Filter routes…",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring sm:w-44","aria-label":"Filter routes"})]}),0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(d9,{className:"size-5 text-muted-foreground"}),"No endpoints match this filter."]}):o.map(([e,t])=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsxs)("span",{className:"font-mono text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["/",e]}),(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:[t.length," ",1===t.length?"route":"routes"]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-2",children:t.map(e=>(0,eT.jsx)(ct,{endpoint:e},e.id))})]},e))]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4",children:[(0,eT.jsx)(oS,{title:"Surface",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Endpoints"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.endpoints})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Mutations"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.mutations})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Dynamic routes"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.dynamic})]}),e.style&&(0,eT.jsx)("div",{className:"border-t border-border pt-2 text-xs leading-relaxed text-muted-foreground",children:e.style})]})}),(0,eT.jsx)(oS,{title:"Coverage",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsx)(ci,{label:"Protected",pct:d,count:e.counts.protected,total:e.counts.endpoints}),(0,eT.jsx)(ci,{label:"Validated",pct:c,count:e.counts.validated,total:e.counts.endpoints})]})}),e.methodCounts.length>0&&(0,eT.jsxs)(oS,{title:"By method",children:[(0,eT.jsx)(o$,{segments:e.methodCounts.map(e=>({label:e.method,value:e.count,color:function(e){switch(e){case"GET":case"HEAD":case"OPTIONS":return"var(--chart-4)";case"POST":return"var(--chart-1)";case"PUT":case"PATCH":return"var(--chart-2)";case"DELETE":return"var(--chart-3)";default:return"var(--chart-5)"}}(e.method)}))}),(0,eT.jsx)("div",{className:"mt-3 flex flex-col gap-1.5",children:e.methodCounts.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("font-mono font-semibold",d8(e.method).text),children:e.method}),(0,eT.jsx)("span",{className:"font-mono text-muted-foreground",children:e.count})]},e.method))})]}),(0,eT.jsx)(oS,{title:"Findings",children:(0,eT.jsx)("div",{className:"flex items-center gap-2",children:0===e.counts.findings?(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(eV,{className:"size-4 text-[color:var(--sev-ok)]"}),(0,eT.jsx)("span",{className:"text-sm text-muted-foreground",children:"No API issues found"})]}):(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(eB,{className:"size-4 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("span",{className:"text-sm text-foreground",children:[e.counts.findings," ",1===e.counts.findings?"issue":"issues"," across the surface"]})]})})})]})]})}function ct({endpoint:e}){let[t,n]=(0,eP.useState)(!1),r=d8(e.method),i=e.findings.length>0,a=i?e.findings.reduce((e,t)=>ca(t.severity)>ca(e)?t.severity:e,e.findings[0].severity):null;return(0,eT.jsxs)(s8,{className:(0,ny.cn)("overflow-hidden transition-colors",t&&"ring-1 ring-border"),children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("shrink-0 rounded-sm border px-2 py-0.5 font-mono text-[11px] font-semibold uppercase",r.bg,r.border,r.text),children:e.method}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm text-foreground",children:e.path}),(0,eT.jsxs)("div",{className:"hidden items-center gap-1.5 sm:flex",children:[(0,eT.jsx)(cn,{ok:e.flags.auth,okIcon:dm,noIcon:dD,okLabel:"auth",noLabel:"public"}),(0,eT.jsx)(cn,{ok:e.flags.validation,okIcon:da,noIcon:d9,okLabel:"valid",noLabel:"no schema",muted:!d7.includes(e.method)}),e.flags.database&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3"}),"db"]})]}),i&&a&&(0,eT.jsx)("span",{className:(0,ny.cn)("shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase",oV(a).bg,oV(a).text),children:e.findings.length}),(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 shrink-0 text-muted-foreground transition-transform",t&&"rotate-90")})]}),t&&(0,eT.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-background/40 p-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase",children:function(e){switch(e){case"next-app":return"App Route";case"next-pages":return"Pages API";case"next-action":return"Server Action";case"sveltekit":return"SvelteKit";case"nuxt":return"Nuxt";default:return e}}(e.kind)}),e.dynamic&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px]",children:"dynamic"}),e.handler&&(0,eT.jsxs)("span",{className:"font-mono text-[10px]",children:["handler: ",e.handler]})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border font-mono text-xs sm:grid-cols-3",children:[(0,eT.jsx)(cr,{label:"auth",on:e.flags.auth}),(0,eT.jsx)(cr,{label:"validation",on:e.flags.validation}),(0,eT.jsx)(cr,{label:"error handling",on:e.flags.errorHandling}),(0,eT.jsx)(cr,{label:"reads input",on:e.flags.inputs,neutral:!0}),(0,eT.jsx)(cr,{label:"database",on:e.flags.database,neutral:!0}),(0,eT.jsx)(cr,{label:"env access",on:e.flags.env,neutral:!0})]}),i&&(0,eT.jsx)("ul",{className:"flex flex-col gap-2",children:e.findings.map(e=>{let t=oV(e.severity);return(0,eT.jsxs)("li",{className:"rounded-sm border border-border bg-card p-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("size-1.5 rounded-full",t.dot),"aria-hidden":!0}),(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)("span",{className:(0,ny.cn)("ml-auto font-mono text-[10px] uppercase",t.text),children:t.label})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsxs)("p",{className:"mt-1.5 text-pretty text-xs leading-relaxed text-foreground/80",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"fix:"})," ",e.recommendation]})]},e.id)})})]})]})}function cn({ok:e,okIcon:t,noIcon:n,okLabel:r,noLabel:i,muted:a}){return a?null:(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 font-mono text-[10px]",e?"border-border bg-secondary text-muted-foreground":"border-foreground/40 bg-background font-semibold text-foreground"),children:[(0,eT.jsx)(e?t:n,{className:"size-3"}),e?r:i]})}function cr({label:e,on:t,neutral:n}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between bg-card px-2.5 py-1.5",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)(n?"text-foreground/70":t?"font-semibold text-foreground":"text-muted-foreground"),children:t?"yes":"no"})]})}function ci({label:e,pct:t,count:n,total:r}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:"font-mono text-foreground",children:[n,"/",r," · ",t,"%"]})]}),(0,eT.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-foreground",style:{width:`${t}%`},"aria-hidden":!0})})]})}function ca(e){return({critical:5,high:4,medium:3,low:2,info:1})[e]??0}let cs=eL("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),co=eL("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),cl=eL("fingerprint-pattern",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]),cd={"two-factor":"Two-Factor",passwordless:"Passwordless",social:"Social",authorization:"Authorization",session:"Session",api:"API",enterprise:"Enterprise",integration:"Integration",utility:"Utility",other:"Other"},cc={ok:"var(--sev-ok)",warn:"var(--sev-medium)",fail:"var(--sev-critical)",info:"var(--muted-foreground)"};function cu({method:e}){var t;let n="credential"===(t=e.kind)?eH:"social"===t?eG:cl;return(0,eT.jsx)(s8,{className:"gap-0 p-4",children:(0,eT.jsxs)("div",{className:"flex items-start gap-3",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-9 shrink-0 items-center justify-center rounded-sm border",e.enabled?"border-[color:var(--sev-ok)]/40 text-[color:var(--sev-ok)]":"border-border text-muted-foreground"),children:(0,eT.jsx)(n,{className:"size-4"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:e.label}),(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",e.enabled?"bg-[color:var(--sev-ok)]/12 text-[color:var(--sev-ok)]":"bg-secondary text-muted-foreground"),children:e.enabled?"On":"Off"})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.providers&&e.providers.length>0&&(0,eT.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:e.providers.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-1.5 py-0.5 font-mono text-[10px] capitalize text-muted-foreground",children:e},e))})]})]})})}function cm({plugin:e,onOpen:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-start gap-3 rounded-sm border border-border bg-card p-3 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(cs,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:cd[e.category]}),e.clientMissing&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-medium)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3"}),"client missing"]})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,eT.jsxs)("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1",e.detectedServer?"text-[color:var(--sev-ok)]":"text-muted-foreground/50"),children:[(0,eT.jsx)(dF,{className:"size-3"}),"server"]}),e.needsClient&&(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1",e.detectedClient?"text-[color:var(--sev-ok)]":"text-[color:var(--sev-medium)]"),children:[(0,eT.jsx)(co,{className:"size-3"}),"client"]})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cp({item:e}){let t=cc[e.status];return(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"size-2 shrink-0 rounded-full",style:{background:t},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"text-sm text-foreground",children:e.label})]}),e.detail&&(0,eT.jsx)("p",{className:"mt-1 pl-4 text-xs text-muted-foreground",children:e.detail}),e.recommendation&&(0,eT.jsx)("p",{className:"mt-1 pl-4 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.recommendation})]}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-xs",style:{color:t},children:e.value})]})}function cf({f:e,onOpen:t}){let n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-4 shrink-0",style:{color:`var(--sev-${e.severity})`}}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function ch({auth:e}){let[t,n]=(0,eP.useState)(null),[r,i]=(0,eP.useState)(null),a=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.plugins)t.set(n.category,(t.get(n.category)??0)+1);return[...t.entries()].map(([e,t],n)=>({label:cd[e],value:t,color:`var(--chart-${n%5+1})`}))},[e.plugins]);if(!e.present)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(eV,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No auth provider detected"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["Projectlens looks for popular auth libraries — ",(0,eT.jsx)("span",{className:"font-mono",children:"better-auth"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"@clerk/nextjs"}),", ",(0,eT.jsx)("span",{className:"font-mono",children:"next-auth"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"@supabase/supabase-js"}),", ",(0,eT.jsx)("span",{className:"font-mono",children:"lucia"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"firebase"})," and more. Install one to see a breakdown here."]})]})]});let o=e.provider,l=o?.deepSupport??!1;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:o?.name??"Auth",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-foreground",children:[(0,eT.jsx)(eV,{className:"size-4 text-[color:var(--sev-ok)]"}),"Detected"]}),e.version&&(0,eT.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:["v",e.version]})]}),!l&&(0,eT.jsx)("div",{className:"rounded-sm border border-[color:var(--sev-medium)]/30 bg-[color:var(--sev-medium)]/10 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"Provider-level analysis. Deep config introspection (methods, plugins, session) is available for Better Auth."}),e.integration&&(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Integration"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.integration})]}),e.databaseAdapter&&(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3"}),"Adapter"]}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.databaseAdapter.name})]}),e.configPath&&(0,eT.jsx)("div",{className:"border-t border-border pt-2 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.configPath})}),e.clientPath&&(0,eT.jsx)("div",{className:"font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.clientPath})}),o&&(0,eT.jsxs)("a",{href:o.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 border-t border-border pt-2 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[o.name," docs",(0,eT.jsx)(oE,{className:"size-3"})]})]})}),(0,eT.jsx)(oS,{title:"At a glance",children:(0,eT.jsx)("div",{className:"grid grid-cols-3 gap-2 text-center",children:[{label:"Methods",value:e.counts.methods,icon:eH},{label:"Plugins",value:e.counts.plugins,icon:cs},{label:"Issues",value:e.counts.findings,icon:dw}].map(e=>(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 rounded-sm bg-secondary/40 py-2",children:[(0,eT.jsx)(e.icon,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-foreground",children:e.value}),(0,eT.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.label})]},e.label))})}),s.length>0&&(0,eT.jsx)(oS,{title:"Plugins by category",children:(0,eT.jsx)(o$,{segments:s})}),e.socialProviders.length>0&&(0,eT.jsx)(oS,{title:"Social providers",children:(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.socialProviders.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] capitalize text-foreground",children:e},e))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Sign-in methods"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.methods.length})]}),0===e.methods.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-5 text-[color:var(--sev-medium)]"}),"No sign-in methods detected in the config."]}):(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.methods.map(e=>(0,eT.jsx)(cu,{method:e},e.id))})]}),l&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cs,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Plugins"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.plugins.length})]}),0===e.plugins.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(te,{className:"size-5 text-muted-foreground"}),"No ",o?.name??"auth"," plugins are registered."]}):(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.plugins.map(e=>(0,eT.jsx)(cm,{plugin:e,onOpen:()=>n(e)},e.id))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eJ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Configuration"})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:e.config.map(e=>(0,eT.jsx)(cp,{item:e},e.key))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eV,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Auth findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:a.length})]}),0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No authentication issues detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>(0,eT.jsx)(cf,{f:e,onOpen:()=>i(e)},e.id))})]})]}),(0,eT.jsx)(cg,{plugin:t,onClose:()=>n(null)}),(0,eT.jsx)(cx,{finding:r,onClose:()=>i(null)})]})}function cg({plugin:e,onClose:t}){return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:e&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:cd[e.category]}),e.clientMissing&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-medium)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3"}),"client missing"]})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-base",children:e.name}),(0,eT.jsx)(oF,{className:"text-pretty leading-relaxed",children:e.description})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Server"}),(0,eT.jsx)("span",{className:"font-mono text-sm",style:{color:e.detectedServer?"var(--sev-ok)":"var(--muted-foreground)"},children:e.detectedServer?"Registered":"Not found"})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Client"}),(0,eT.jsx)("span",{className:"font-mono text-sm",style:{color:e.needsClient?e.detectedClient?"var(--sev-ok)":"var(--sev-medium)":"var(--muted-foreground)"},children:e.needsClient?e.detectedClient?"Registered":"Missing":"Not required"})]})]}),e.clientMissing&&(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-sm border border-[color:var(--sev-medium)]/30 bg-[color:var(--sev-medium)]/[0.06] p-3",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3.5"}),"Client plugin missing"]}),(0,eT.jsxs)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:["Add ",(0,eT.jsxs)("span",{className:"font-mono",children:[e.id,"Client()"]})," to your"," ",(0,eT.jsx)("span",{className:"font-mono",children:"createAuthClient()"})," plugins so its actions work in the browser."]})]}),e.addsTables&&e.addsTables.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3.5"}),"Database tables added"]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.addsTables.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] text-foreground",children:e},e))}),(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:"Generate and apply migrations after adding this plugin so these tables exist."})]}),(0,eT.jsxs)("a",{href:e.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm border border-border px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:["Plugin docs",(0,eT.jsx)(oE,{className:"size-3.5"})]})]})]})})})}function cx({finding:e,onClose:t}){let n=e?oV(e.severity):null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:e&&n&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("w-fit border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-base leading-relaxed",children:e.title}),(0,eT.jsx)(oF,{className:"sr-only",children:"Authentication finding detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-3.5"}),"Issue"]}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(dm,{className:"size-3.5"}),"Recommendation"]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-pretty text-sm leading-relaxed text-foreground",children:e.recommendation})]}),e.docsUrl&&(0,eT.jsxs)("a",{href:e.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm border border-border px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:["Better Auth docs",(0,eT.jsx)(oE,{className:"size-3.5"})]})]})]})})})}let cv=eL("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),cy=eL("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),cb={ok:"Healthy",missing:"Missing",undocumented:"Undocumented",unused:"Unused",exposed:"Exposed",empty:"Empty"};function ck({v:e}){let{viewIssue:t}=l$(),n=oV(e.severity),r="ok"!==e.status;return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oX(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oX(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:["client"===e.scope?(0,eT.jsx)(co,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dF,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.key}),e.sample&&(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.sample}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.scope}),r?(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:cb[e.status]}):(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(eV,{className:"size-3"}),"OK"]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.note})]}),(0,eT.jsx)(lM,{issue:oX(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cj({v:e,shown:t,onToggle:n}){let[r,i]=(0,eP.useState)(!1),a=void 0===e.value,s=a?"(not set)":""===e.value?"(empty)":e.value,o=e.values?[...e.values].sort((e,t)=>{let n={".env.local":0,".env.example":1};return(n[e.file]??2)-(n[t.file]??2)}):[];return(0,eT.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-3",children:["client"===e.scope?(0,eT.jsx)(co,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dF,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.key}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.scope})]}),(0,eT.jsx)("p",{className:(0,ny.cn)("mt-1.5 break-all font-mono text-xs",a?"text-muted-foreground/60 italic":t?"text-foreground":"tracking-widest text-muted-foreground"),children:a||t?s:"•".repeat(Math.min(28,Math.max(8,(e.value||"").length||12)))})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[!a&&(0,eT.jsx)("button",{type:"button",onClick:()=>{a||navigator.clipboard?.writeText(e.value??"").then(()=>{i(!0),window.setTimeout(()=>i(!1),1400)})},"aria-label":"Copy value",className:"inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:r?(0,eT.jsx)(iq,{className:"size-3.5 text-[color:var(--sev-ok)]"}):(0,eT.jsx)(oC,{className:"size-3.5"})}),(0,eT.jsx)("button",{type:"button",onClick:n,disabled:a,"aria-label":t?"Hide value":"Reveal value","aria-pressed":t,className:"inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground disabled:opacity-30",children:t?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"})})]})]}),o.length>1&&(0,eT.jsx)("div",{className:"ml-7 flex flex-col gap-1 border-l border-border/50 pl-3 text-xs",children:o.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.file}),(0,eT.jsx)("span",{className:(0,ny.cn)("font-mono truncate",null===e.value?"text-muted-foreground/60 italic":"text-foreground"),children:null===e.value?"(not set)":""===e.value?"(empty)":t?e.value:"•".repeat(Math.min(12,Math.max(4,(e.value||"").length||8)))})]},e.file))})]})}function cw({env:e}){let[t,n]=(0,eP.useState)(!1),[r,i]=(0,eP.useState)(new Set),a=(0,eP.useMemo)(()=>[...e.variables].sort((e,t)=>e.key.localeCompare(t.key)),[e.variables]),s=a.filter(e=>void 0!==e.value);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Variable values"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[s.length," set"]})]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{n(e=>!e),i(new Set)},"aria-pressed":t,className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[t?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"}),t?"Hide all":"Reveal all"]})]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:"Values are read from your local env files and rendered only in your browser. They are hidden by default — use the eye toggle to reveal a single value or reveal all at once."}),0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No environment variables found."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>{let n;return(0,eT.jsx)(cj,{v:e,shown:(n=e.key,t||r.has(n)),onToggle:()=>{let t;return t=e.key,i(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}},e.key)})})]})}function cN({env:e}){let[t,n]=(0,eP.useState)("audit"),[r,i]=(0,eP.useState)("all"),a=(0,eP.useMemo)(()=>[...e.variables].sort(oq),[e.variables]),s=(0,eP.useMemo)(()=>"all"===r?a:"issues"===r?a.filter(e=>"ok"!==e.status):a.filter(e=>e.status===r),[a,r]),o=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.variables)t.set(n.status,(t.get(n.status)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:cb[e],count:t})).sort((e,t)=>t.count-e.count)},[e.variables]),l=[{label:"Server",value:e.counts.server,color:"var(--chart-1)"},{label:"Client",value:e.counts.client,color:"var(--chart-3)"}],d=e.variables.filter(e=>"exposed"===e.status).length,c=e.variables.filter(e=>"missing"===e.status).length,u=[{key:"audit",label:"Audit",icon:sn,count:e.counts.issues},{key:"values",label:"Values",icon:oT,count:e.counts.total}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:u.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-4"}),e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"values"===t?(0,eT.jsx)(cw,{env:e}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Variables",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.issues}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"with issues"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:d>0?"var(--sev-critical)":"var(--sev-ok)"},children:d}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"exposed"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:c>0?"var(--sev-high)":"var(--sev-ok)"},children:c}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"missing"})]})]})}),(0,eT.jsx)(oS,{title:"By scope",children:(0,eT.jsx)(o$,{segments:l})}),(0,eT.jsx)(oS,{title:"By status",children:(0,eT.jsx)(oI,{rows:o,activeKey:"all"===r||"issues"===r?null:r,onSelect:e=>i(t=>t===e?"all":e)})}),(0,eT.jsx)(oS,{title:"Env files",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.files.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)(si,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.present?"text-foreground":"text-muted-foreground line-through"),children:e.path})]}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.present?`${e.vars}`:"—"})]},e.path))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[{key:"all",label:"All",count:e.counts.total},{key:"issues",label:"Issues",count:e.counts.issues},...o.filter(e=>"ok"!==e.key).map(e=>({key:e.key,label:e.label,count:e.count}))].map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",r===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Environment variables"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:s.length})]}),0===s.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No variables in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:s.map(e=>(0,eT.jsx)(ck,{v:e},e.key))})]})]})]})}let c_=eL("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);function cS(e){let t=e.issues.map(e=>oV(e.severity).rank);return t.length?Math.max(...t):0}function c$({call:e}){let{viewIssue:t}=l$(),n=[...e.issues].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank)[0],r=n?oV(n.severity):null;return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oQ(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oQ(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[e.secure?(0,eT.jsx)(dm,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dD,{className:"mt-0.5 size-4 shrink-0 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:e.method}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:e.url})]}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:e.client}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:e.external?"external":"internal"}),r&&(0,eT.jsxs)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",r.bg,r.text),children:[e.issues.length," ",1===e.issues.length?"issue":"issues"]})]}),n&&(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:n.message})]}),(0,eT.jsx)(lM,{issue:oQ(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cI({network:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)("all"),a=(0,eP.useMemo)(()=>[...e.calls].sort((e,t)=>cS(t)-cS(e)),[e.calls]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.calls)t.set(n.method,(t.get(n.method)??0)+1);let n=[...t.entries()].sort((e,t)=>t[1]-e[1]);return[{key:"all",count:e.calls.length},...n.map(([e,t])=>({key:e,count:t}))]},[e.calls]),o=(0,eP.useMemo)(()=>{let e=(()=>{switch(t){case"external":return a.filter(e=>e.external);case"insecure":return a.filter(e=>!e.secure);case"issues":return a.filter(e=>e.issues.length>0);default:return a}})();return"all"===r?e:e.filter(e=>e.method===r)},[a,t,r]),l=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.domains)t.set(n.category,(t.get(n.category)??0)+n.calls);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.domains]),d=[{label:"HTTPS",value:e.calls.filter(e=>e.secure).length,color:"var(--chart-1)"},{label:"HTTP",value:e.calls.filter(e=>!e.secure).length,color:"var(--chart-3)"}],c=[{key:"all",label:"All",count:e.counts.total},{key:"issues",label:"Issues",count:e.counts.issues},{key:"external",label:"External",count:e.counts.external},{key:"insecure",label:"Insecure",count:e.counts.insecure}];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Requests",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total calls"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.external}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"external"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:e.counts.insecure>0?"var(--sev-high)":"var(--sev-ok)"},children:e.counts.insecure}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"insecure"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.domains.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"hosts"})]})]})}),(0,eT.jsx)(oS,{title:"By scheme",children:(0,eT.jsx)(o$,{segments:d})}),(0,eT.jsx)(oS,{title:"Traffic by category",children:(0,eT.jsx)(oI,{rows:l})}),(0,eT.jsx)(oS,{title:"Hosts",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.domains.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between gap-2 font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.external?(0,eT.jsx)(s2,{className:"size-3 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eG,{className:"size-3 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.host})]}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.calls})]},e.host))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:c.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),s.length>2&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 pr-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(c_,{className:"size-3.5"}),"Method"]}),s.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2 py-1 font-mono text-[11px] uppercase transition-colors",r===e.key?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:["all"===e.key?"All":e.key,(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.count})]},e.key))]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eG,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Outbound requests"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:o.length})]}),0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No requests in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:o.map(e=>(0,eT.jsx)(c$,{call:e},e.id))})]})]})}let cE=eL("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),cC=eL("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),cA=eL("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),cT=eL("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),cP=eL("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),cz=eL("git-graph",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v6",key:"158jrl"}],["circle",{cx:"5",cy:"18",r:"3",key:"104gr9"}],["path",{d:"M12 3v18",key:"108xh3"}],["circle",{cx:"19",cy:"6",r:"3",key:"108a5v"}],["path",{d:"M16 15.7A9 9 0 0 0 19 9",key:"1e3vqb"}]]),cO=eL("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]),cM=eL("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]),cR=eL("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),cD=eL("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]),cL=eL("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]),cU=eL("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]),cZ=eL("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["ERROR_REVALIDATE_EVENT",0,3,"FOCUS_EVENT",0,0,"MUTATE_EVENT",0,2,"RECONNECT_EVENT",0,1],67005);var cF=Object.prototype.hasOwnProperty;let cB=new WeakMap,cV=()=>{},cq=cV(),cW=Object,cH=e=>e===cq,cG=(e,t)=>({...e,...t}),cK={},cJ={},cY="undefined",cX=typeof window!=cY,cQ=typeof document!=cY,c0=cX&&"Deno"in window,c1=(e,t)=>{let n=cB.get(e);return[()=>!cH(t)&&e.get(t)||cK,r=>{if(!cH(t)){let i=e.get(t);t in cJ||(cJ[t]=i),n[5](t,cG(i,r),i||cK)}},n[6],()=>!cH(t)&&t in cJ?cJ[t]:!cH(t)&&e.get(t)||cK]},c2=!0,[c4,c5]=cX&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[cV,cV],c6={initFocus:e=>(cQ&&document.addEventListener("visibilitychange",e),c4("focus",e),()=>{cQ&&document.removeEventListener("visibilitychange",e),c5("focus",e)}),initReconnect:e=>{let t=()=>{c2=!0,e()},n=()=>{c2=!1};return c4("online",t),c4("offline",n),()=>{c5("online",t),c5("offline",n)}}},c3=!eP.default.useId,c9=!cX||c0,c8=c9?eP.useEffect:eP.useLayoutEffect,c7="u">typeof navigator&&navigator.connection,ue=!c9&&c7&&(["slow-2g","2g"].includes(c7.effectiveType)||c7.saveData),ut=new WeakMap,un=(e,t)=>e===`[object ${t}]`,ur=0,ui=e=>{let t,n,r=typeof e,i=cW.prototype.toString.call(e),a=un(i,"Date"),s=un(i,"RegExp"),o=un(i,"Object");if(cW(e)!==e||a||s)t=a?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=ut.get(e))return t;if(t=++ur+"~",ut.set(e,t),Array.isArray(e)){for(n=0,t="@";n<e.length;n++)t+=ui(e[n])+",";ut.set(e,t)}if(o){t="#";let r=cW.keys(e).sort();for(;!cH(n=r.pop());)cH(e[n])||(t+=n+":"+ui(e[n])+",");ut.set(e,t)}}return t},ua=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?ui(e):"",t]},us=0,uo=()=>++us;async function ul(...e){let[t,n,r,i]=e,a=cG({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),s=a.populateCache,o=a.rollbackOnError,l=a.optimisticData,d=a.throwOnError;if("function"==typeof n){let e=[];for(let r of t.keys())!/^\$(inf|sub)\$/.test(r)&&n(t.get(r)._k)&&e.push(r);return Promise.all(e.map(c))}return c(n);async function c(n){let i,[c]=ua(n);if(!c)return;let[u,m]=c1(t,c),[p,f,h,g]=cB.get(t),x=()=>{let e=p[c];return("function"==typeof a.revalidate?a.revalidate(u().data,n):!1!==a.revalidate)&&(delete h[c],delete g[c],e&&e[0])?e[0](2).then(()=>u().data):u().data};if(e.length<3)return x();let v=r,y=!1,b=uo();f[c]=[b,0];let k=!cH(l),j=u(),w=j.data,N=j._c,_=cH(N)?w:N;if(k&&m({data:l="function"==typeof l?l(_,w):l,_c:_}),"function"==typeof v)try{v=v(_)}catch(e){i=e,y=!0}if(v&&"function"==typeof v.then){let e;if(v=await v.catch(e=>{i=e,y=!0}),b!==f[c][0]){if(y)throw i;return v}y&&k&&(e=i,"function"==typeof o?o(e):!1!==o)&&(s=!0,m({data:_,_c:cq}))}if(s&&!y&&("function"==typeof s?m({data:s(v,_),error:cq,_c:cq}):m({data:v,error:cq,_c:cq})),f[c][1]=uo(),Promise.resolve(x()).then(()=>{m({_c:cq})}),y){if(d)throw i;return}return v}}let ud=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},uc=(e,t)=>{if(!cB.has(e)){let n=cG(c6,t),r=Object.create(null),i=ul.bind(cq,e),a=cV,s=Object.create(null),o=(e,t)=>{let n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},l=(t,n,r)=>{e.set(t,n);let i=s[t];if(i)for(let e of i)e(n,r)},d=()=>{if(!cB.has(e)&&(cB.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,o]),!c9)){let t=n.initFocus(setTimeout.bind(cq,ud.bind(cq,r,0))),i=n.initReconnect(setTimeout.bind(cq,ud.bind(cq,r,1)));a=()=>{t&&t(),i&&i(),cB.delete(e)}}};return d(),[e,i,d,a]}return[e,cB.get(e)[4]]},[uu,um]=uc(new Map),up=cG({onLoadingSlow:cV,onSuccess:cV,onError:cV,onErrorRetry:(e,t,n,r,i)=>{let a=n.errorRetryCount,s=i.retryCount,o=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;(cH(a)||!(s>a))&&setTimeout(r,o,i)},onDiscarded:cV,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ue?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:ue?5e3:3e3,compare:function e(t,n){var r,i;if(t===n)return!0;if(t&&n&&(r=t.constructor)===n.constructor){if(r===Date)return t.getTime()===n.getTime();if(r===RegExp)return t.toString()===n.toString();if(r===Array){if((i=t.length)===n.length)for(;i--&&e(t[i],n[i]););return -1===i}if(!r||"object"==typeof t){for(r in i=0,t)if(cF.call(t,r)&&++i&&!cF.call(n,r)||!(r in n)||!e(t[r],n[r]))return!1;return Object.keys(n).length===i}}return t!=t&&n!=n},isPaused:()=>!1,cache:uu,mutate:um,fallback:{}},{isOnline:()=>c2,isVisible:()=>{let e=cQ&&document.visibilityState;return cH(e)||"hidden"!==e}}),uf=(e,t)=>{let n=cG(e,t);if(t){let{use:r,fallback:i}=e,{use:a,fallback:s}=t;r&&a&&(n.use=r.concat(a)),i&&s&&(n.fallback=cG(i,s))}return n},uh=(0,eP.createContext)({});var ug=e.i(67005);let ux=cX&&window.__SWR_DEVTOOLS_USE__,uv=(ux?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,n,r)=>{let i=n&&((...e)=>{let[r]=ua(t),[,,,i]=cB.get(uu);if(r.startsWith("$inf$"))return n(...e);let a=i[r];return cH(a)?n(...e):(delete i[r],a)});return e(t,i,r)});ux&&(window.__SWR_DEVTOOLS_REACT__=eP.default);let uy=()=>{},ub=uy(),uk=(new WeakMap,eP.default.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}})),uj={dedupe:!0},uw=Promise.resolve(cq),uN=()=>cV;cW.defineProperty(e=>{let{value:t}=e,n=(0,eP.useContext)(uh),r="function"==typeof t,i=(0,eP.useMemo)(()=>r?t(n):t,[r,n,t]),a=(0,eP.useMemo)(()=>r?i:uf(n,i),[r,n,i]),s=i&&i.provider,o=(0,eP.useRef)(cq);s&&!o.current&&(o.current=uc(s(a.cache||uu),i));let l=o.current;return l&&(a.cache=l[0],a.mutate=l[1]),c8(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,eP.createElement)(uh.Provider,cG(e,{value:a}))},"defaultValue",{value:up});let u_=(n=(e,t,n)=>{let{cache:r,compare:i,suspense:a,fallbackData:s,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:d,refreshWhenHidden:c,refreshWhenOffline:u,keepPreviousData:m,strictServerPrefetchWarning:p}=n,[f,h,g,x]=cB.get(r),[v,y]=ua(e),b=(0,eP.useRef)(!1),k=(0,eP.useRef)(!1),j=(0,eP.useRef)(v),w=(0,eP.useRef)(t),N=(0,eP.useRef)(n),_=()=>N.current.isVisible()&&N.current.isOnline(),[S,$,I,E]=c1(r,v),C=(0,eP.useRef)({}).current,A=cH(s)?cH(n.fallback)?cq:n.fallback[v]:s,T=(e,t)=>{for(let n in C)if("data"===n){if(!i(e[n],t[n])&&(!cH(e[n])||!i(Z,t[n])))return!1}else if(t[n]!==e[n])return!1;return!0},P=!b.current,z=(0,eP.useMemo)(()=>{let e=S(),n=E(),r=e=>{let n=cG(e);return(delete n._k,(()=>{if(!v||!t||N.current.isPaused())return!1;if(P&&!cH(o))return o;let e=cH(A)?n.data:A;return cH(e)||l})())?{isValidating:!0,isLoading:!0,...n}:n},i=r(e),a=e===n?i:r(n),s=i;return[()=>{let e=r(S());return T(e,s)?(s.data=e.data,s.isLoading=e.isLoading,s.isValidating=e.isValidating,s.error=e.error,s):(s=e,e)},()=>a]},[r,v]),O=(0,tL.useSyncExternalStore)((0,eP.useCallback)(e=>I(v,(t,n)=>{T(n,t)||e()}),[r,v]),z[0],z[1]),M=f[v]&&f[v].length>0,R=O.data,D=cH(R)?A&&"function"==typeof A.then?uk(A):A:R,L=O.error,U=(0,eP.useRef)(D),Z=m?cH(R)?cH(U.current)?D:U.current:R:D,F=v&&cH(D),B=(0,eP.useRef)(null);c9||(0,tL.useSyncExternalStore)(uN,()=>(B.current=!1,B),()=>(B.current=!0,B));let V=B.current;p&&V&&!a&&F&&console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let q=!(!v||!t||N.current.isPaused())&&(!M||!!cH(L))&&(P&&!cH(o)?o:a?!cH(D)&&l:cH(D)||l),W=P&&q,H=cH(O.isValidating)?W:O.isValidating,G=cH(O.isLoading)?W:O.isLoading,K=(0,eP.useCallback)(async e=>{let t,r,a=w.current;if(!v||!a||k.current||N.current.isPaused())return!1;let s=!0,o=e||{},l=!g[v]||!o.dedupe,d=()=>c3?!k.current&&v===j.current&&b.current:v===j.current,c={isValidating:!1,isLoading:!1},u=()=>{$(c)},m=()=>{let e=g[v];e&&e[1]===r&&delete g[v]},p={isValidating:!0};cH(S().data)&&(p.isLoading=!0);try{if(l&&($(p),n.loadingTimeout&&cH(S().data)&&setTimeout(()=>{s&&d()&&N.current.onLoadingSlow(v,n)},n.loadingTimeout),g[v]=[a(y),uo()]),[t,r]=g[v],t=await t,l&&setTimeout(m,n.dedupingInterval),!g[v]||g[v][1]!==r)return l&&d()&&N.current.onDiscarded(v),!1;c.error=cq;let e=h[v];if(!cH(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return u(),l&&d()&&N.current.onDiscarded(v),!1;let o=S().data;c.data=i(o,t)?o:t,l&&d()&&N.current.onSuccess(t,v,n)}catch(n){m();let e=N.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=n,l&&d())&&(e.onError(n,v,e),(!0===t||"function"==typeof t&&t(n))&&(!N.current.revalidateOnFocus||!N.current.revalidateOnReconnect||_())&&e.onErrorRetry(n,v,e,e=>{let t=f[v];t&&t[0]&&t[0](ug.ERROR_REVALIDATE_EVENT,e)},{retryCount:(o.retryCount||0)+1,dedupe:!0}))}return s=!1,u(),!0},[v,r]),J=(0,eP.useCallback)((...e)=>ul(r,j.current,...e),[]);if(c8(()=>{w.current=t,N.current=n,cH(R)||(U.current=R)}),c8(()=>{var e;let t;if(!v)return;let n=K.bind(cq,uj),r=0;N.current.revalidateOnFocus&&(r=Date.now()+N.current.focusThrottleInterval);let i=(e=(e,t={})=>{if(e==ug.FOCUS_EVENT){let e=Date.now();N.current.revalidateOnFocus&&e>r&&_()&&(r=e+N.current.focusThrottleInterval,n())}else if(e==ug.RECONNECT_EVENT)N.current.revalidateOnReconnect&&_()&&n();else if(e==ug.MUTATE_EVENT)return K();else if(e==ug.ERROR_REVALIDATE_EVENT)return K(t)},(t=f[v]||(f[v]=[])).push(e),()=>{let n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.pop())});if(k.current=!1,j.current=v,b.current=!0,$({_k:y}),q&&!g[v])if(cH(D)||c9)n();else cX&&typeof window.requestAnimationFrame!=cY?window.requestAnimationFrame(n):setTimeout(n,1);return()=>{k.current=!0,i()}},[v]),c8(()=>{let e;function t(){let t="function"==typeof d?d(S().data):d;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!S().error&&(c||N.current.isVisible())&&(u||N.current.isOnline())?K(uj).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[d,c,u,v]),(0,eP.useDebugValue)(Z),a){if(!c3&&c9&&F)throw Error("Fallback data is required when using Suspense in SSR.");F&&(w.current=t,N.current=n,k.current=!1);let e=x[v];if(uk(!cH(e)&&F?J(e):uw),!cH(L)&&F)throw L;let r=F?K(uj):uw;!cH(Z)&&F&&(r.status="fulfilled",r.value=!0),uk(r)}return{mutate:J,get data(){return C.data=!0,Z},get error(){return C.error=!0,L},get isValidating(){return C.isValidating=!0,H},get isLoading(){return C.isLoading=!0,G}}},function(...e){let t,r=(t=(0,eP.useContext)(uh),(0,eP.useMemo)(()=>cG(up,t),[t])),[i,a,s]="function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],o=uf(r,s),l=n,{use:d}=o,c=(d||[]).concat(uv);for(let e=c.length;e--;)l=c[e](l);return l(i,a||o.fetcher||null,o)}),uS=eL("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),u$=eL("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]),uI=eL("trophy",[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]]),uE=eL("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),uC=eL("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);function uA(){}function uT(){}let uP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uO={};function uM(e,t){return((t||uO).jsx?uz:uP).test(e)}let uR=/[ \t\n\f\r]/g;function uD(e){return""===e.replace(uR,"")}class uL{constructor(e,t){this.attribute=t,this.property=e}}uL.prototype.attribute="",uL.prototype.booleanish=!1,uL.prototype.boolean=!1,uL.prototype.commaOrSpaceSeparated=!1,uL.prototype.commaSeparated=!1,uL.prototype.defined=!1,uL.prototype.mustUseProperty=!1,uL.prototype.number=!1,uL.prototype.overloadedBoolean=!1,uL.prototype.property="",uL.prototype.spaceSeparated=!1,uL.prototype.space=void 0;let uU=0,uZ=uG(),uF=uG(),uB=uG(),uV=uG(),uq=uG(),uW=uG(),uH=uG();function uG(){return 2**++uU}e.s(["boolean",0,uZ,"booleanish",0,uF,"commaOrSpaceSeparated",0,uH,"commaSeparated",0,uW,"number",0,uV,"overloadedBoolean",0,uB,"spaceSeparated",0,uq],35999);var uK=e.i(35999);let uJ=Object.keys(uK);class uY extends uL{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<uJ.length;){const e=uJ[i];!function(e,t,n){n&&(e[t]=n)}(this,uJ[i],(n&uK[e])===uK[e])}}}function uX(e){return e.toLowerCase()}uY.prototype.defined=!0;let uQ=/[A-Z]/g,u0=/-[a-z]/g,u1=/^data[-\w.:]+$/i;function u2(e){return"-"+e.toLowerCase()}function u4(e){return e.charAt(1).toUpperCase()}let u5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class u6{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function u3(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new u6(n,r,t)}function u9(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new uY(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[uX(r)]=r,n[uX(a.attribute)]=r}return new u6(t,n,e.space)}u6.prototype.normal={},u6.prototype.property={},u6.prototype.space=void 0;let u8=u9({properties:{ariaActiveDescendant:null,ariaAtomic:uF,ariaAutoComplete:null,ariaBusy:uF,ariaChecked:uF,ariaColCount:uV,ariaColIndex:uV,ariaColSpan:uV,ariaControls:uq,ariaCurrent:null,ariaDescribedBy:uq,ariaDetails:null,ariaDisabled:uF,ariaDropEffect:uq,ariaErrorMessage:null,ariaExpanded:uF,ariaFlowTo:uq,ariaGrabbed:uF,ariaHasPopup:null,ariaHidden:uF,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uq,ariaLevel:uV,ariaLive:null,ariaModal:uF,ariaMultiLine:uF,ariaMultiSelectable:uF,ariaOrientation:null,ariaOwns:uq,ariaPlaceholder:null,ariaPosInSet:uV,ariaPressed:uF,ariaReadOnly:uF,ariaRelevant:null,ariaRequired:uF,ariaRoleDescription:uq,ariaRowCount:uV,ariaRowIndex:uV,ariaRowSpan:uV,ariaSelected:uF,ariaSetSize:uV,ariaSort:null,ariaValueMax:uV,ariaValueMin:uV,ariaValueNow:uV,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function u7(e,t){return t in e?e[t]:t}function me(e,t){return u7(e,t.toLowerCase())}let mt=u9({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:uW,acceptCharset:uq,accessKey:uq,action:null,allow:null,allowFullScreen:uZ,allowPaymentRequest:uZ,allowUserMedia:uZ,alpha:uZ,alt:null,as:null,async:uZ,autoCapitalize:null,autoComplete:uq,autoFocus:uZ,autoPlay:uZ,blocking:uq,capture:null,charSet:null,checked:uZ,cite:null,className:uq,closedBy:null,colorSpace:null,cols:uV,colSpan:uV,command:null,commandFor:null,content:null,contentEditable:uF,controls:uZ,controlsList:uq,coords:uV|uW,crossOrigin:null,data:null,dateTime:null,decoding:null,default:uZ,defer:uZ,dir:null,dirName:null,disabled:uZ,download:uB,draggable:uF,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:uZ,formTarget:null,headers:uq,height:uV,hidden:uB,high:uV,href:null,hrefLang:null,htmlFor:uq,httpEquiv:uq,id:null,imageSizes:null,imageSrcSet:null,inert:uZ,inputMode:null,integrity:null,is:null,isMap:uZ,itemId:null,itemProp:uq,itemRef:uq,itemScope:uZ,itemType:uq,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:uZ,low:uV,manifest:null,max:null,maxLength:uV,media:null,method:null,min:null,minLength:uV,multiple:uZ,muted:uZ,name:null,nonce:null,noModule:uZ,noValidate:uZ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:uZ,optimum:uV,pattern:null,ping:uq,placeholder:null,playsInline:uZ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:uZ,referrerPolicy:null,rel:uq,required:uZ,reversed:uZ,rows:uV,rowSpan:uV,sandbox:uq,scope:null,scoped:uZ,seamless:uZ,selected:uZ,shadowRootClonable:uZ,shadowRootCustomElementRegistry:uZ,shadowRootDelegatesFocus:uZ,shadowRootMode:null,shadowRootSerializable:uZ,shape:null,size:uV,sizes:null,slot:null,span:uV,spellCheck:uF,src:null,srcDoc:null,srcLang:null,srcSet:null,start:uV,step:null,style:null,tabIndex:uV,target:null,title:null,translate:null,type:null,typeMustMatch:uZ,useMap:null,value:uF,width:uV,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uq,axis:null,background:null,bgColor:null,border:uV,borderColor:null,bottomMargin:uV,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:uZ,declare:uZ,event:null,face:null,frame:null,frameBorder:null,hSpace:uV,leftMargin:uV,link:null,longDesc:null,lowSrc:null,marginHeight:uV,marginWidth:uV,noResize:uZ,noHref:uZ,noShade:uZ,noWrap:uZ,object:null,profile:null,prompt:null,rev:null,rightMargin:uV,rules:null,scheme:null,scrolling:uF,standby:null,summary:null,text:null,topMargin:uV,valueType:null,version:null,vAlign:null,vLink:null,vSpace:uV,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:uZ,disablePictureInPicture:uZ,disableRemotePlayback:uZ,exportParts:uW,part:uq,prefix:null,property:null,results:uV,security:null,unselectable:null},space:"html",transform:me}),mn=u9({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:uH,accentHeight:uV,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:uV,amplitude:uV,arabicForm:null,ascent:uV,attributeName:null,attributeType:null,azimuth:uV,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:uV,by:null,calcMode:null,capHeight:uV,className:uq,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:uV,diffuseConstant:uV,direction:null,display:null,dur:null,divisor:uV,dominantBaseline:null,download:uZ,dx:null,dy:null,edgeMode:null,editable:null,elevation:uV,enableBackground:null,end:null,event:null,exponent:uV,externalResourcesRequired:null,fill:null,fillOpacity:uV,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:uW,g2:uW,glyphName:uW,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:uV,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:uV,horizOriginX:uV,horizOriginY:uV,id:null,ideographic:uV,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:uV,k:uV,k1:uV,k2:uV,k3:uV,k4:uV,kernelMatrix:uH,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:uV,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:uV,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:uV,overlineThickness:uV,paintOrder:null,panose1:null,path:null,pathLength:uV,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uq,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:uV,pointsAtY:uV,pointsAtZ:uV,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:uH,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:uH,rev:uH,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:uH,requiredFeatures:uH,requiredFonts:uH,requiredFormats:uH,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:uV,specularExponent:uV,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:uV,strikethroughThickness:uV,string:null,stroke:null,strokeDashArray:uH,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:uV,strokeOpacity:uV,strokeWidth:null,style:null,surfaceScale:uV,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:uH,tabIndex:uV,tableValues:null,target:null,targetX:uV,targetY:uV,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:uH,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:uV,underlineThickness:uV,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:uV,values:null,vAlphabetic:uV,vMathematical:uV,vectorEffect:null,vHanging:uV,vIdeographic:uV,version:null,vertAdvY:uV,vertOriginX:uV,vertOriginY:uV,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:uV,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:u7}),mr=u9({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),mi=u9({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:me}),ma=u9({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ms=u3([u8,mt,mr,mi,ma],"html"),mo=u3([u8,mn,mr,mi,ma],"svg");var ml=e.i(63185);let md=mu("end"),mc=mu("start");function mu(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function mm(e){return e&&"object"==typeof e?"position"in e||"type"in e?mf(e.position):"start"in e||"end"in e?mf(e):"line"in e||"column"in e?mp(e):"":""}function mp(e){return mh(e&&e.line)+":"+mh(e&&e.column)}function mf(e){return mp(e&&e.start)+"-"+mp(e&&e.end)}function mh(e){return e&&"number"==typeof e?e:1}class mg extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=mm(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mg.prototype.file="",mg.prototype.name="",mg.prototype.reason="",mg.prototype.message="",mg.prototype.stack="",mg.prototype.column=void 0,mg.prototype.line=void 0,mg.prototype.ancestors=void 0,mg.prototype.cause=void 0,mg.prototype.fatal=void 0,mg.prototype.place=void 0,mg.prototype.ruleId=void 0,mg.prototype.source=void 0;let mx={}.hasOwnProperty,mv=new Map,my=/[A-Z]/g,mb=new Set(["table","tbody","thead","tfoot","tr"]),mk=new Set(["td","th"]),mj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mw(e,t,n){var r,i,a,s,o,l,d,c,u;let m,p,f,h,g,x,v,y,b,k,j;return"element"===t.type?(r=e,i=t,a=n,p=m=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===m.space&&(r.schema=mo),r.ancestors.push(i),f=m$(r,i.tagName,!1),h=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&mx.call(t.properties,r)){let a=function(e,t,n){let r=function(e,t){let n=uX(t),r=t,i=uL;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&u1.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(u0,u4);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!u0.test(e)){let n=e.replace(uQ,u2);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=uY}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,ml.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new mg("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=mj+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)mx.call(e,t)&&(n[function(e){let t=e.replace(my,mE);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?u5[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(a){let[r,s]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&mk.has(t.tagName)?n=s:i[r]=s}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),g=mS(r,i),mb.has(i.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&uD(e.value):uD(e))})),mN(r,h,f,i),m_(h,g),r.ancestors.pop(),r.schema=m,r.create(i,f,h,a)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return uA("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}mI(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(s=e,o=t,l=n,v=x=s.schema,"svg"===o.name&&"html"===x.space&&(s.schema=mo),s.ancestors.push(o),y=null===o.name?s.Fragment:m$(s,o.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];uA("ExpressionStatement"===t.type);let i=t.expression;uA("ObjectExpression"===i.type);let a=i.properties[0];uA("SpreadElement"===a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else mI(e,t.position);else{let i,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];uA("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else mI(e,t.position);else i=null===r.value||r.value;n[a]=i}return n}(s,o),k=mS(s,o),mN(s,b,y,o),m_(b,k),s.ancestors.pop(),s.schema=x,s.create(o,y,b,l)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mI(e,t.position)}(e,t):"root"===t.type?(d=e,c=t,u=n,m_(j={},mS(d,c)),d.create(c,d.Fragment,j,u)):"text"===t.type?t.value:void 0}function mN(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function m_(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function mS(e,t){let n=[],r=-1,i=e.passKeys?new Map:mv;for(;++r<t.children.length;){let a,s=t.children[r];if(e.passKeys){let e="element"===s.type?s.tagName:"mdxJsxFlowElement"===s.type||"mdxJsxTextElement"===s.type?s.name:void 0;if(e){let t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}let o=mw(e,s,a);void 0!==o&&n.push(o)}return n}function m$(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=uM(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}uA(e,"always a result"),r=e}else r=uM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return mx.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);mI(e)}function mI(e,t){let n=new mg("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function mE(e){return"-"+e.toLowerCase()}let mC={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mA={};function mT(e,t){let n=t||mA;return mP(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function mP(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mz(e.children,t,n)}return Array.isArray(e)?mz(e,t,n):""}function mz(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=mP(e[i],t,n);return r.join("")}function mO(e,t,n,r){let i,a=e.length,s=0;if(t=t<0?-t>a?0:a+t:t>a?a:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);s<r.length;)(i=r.slice(s,s+1e4)).unshift(t,0),e.splice(...i),s+=1e4,t+=1e4}function mM(e,t){return e.length>0?(mO(e,e.length,0,t),e):t}let mR={}.hasOwnProperty;function mD(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(mR.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(r in a){mR.call(i,r)||(i[r]=[]);let e=a[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);mO(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let mL=mY(/[A-Za-z]/),mU=mY(/[\dA-Za-z]/),mZ=mY(/[#-'*+\--9=?A-Z^-~]/);function mF(e){return null!==e&&(e<32||127===e)}let mB=mY(/\d/),mV=mY(/[\dA-Fa-f]/),mq=mY(/[!-/:-@[-`{-~]/);function mW(e){return null!==e&&e<-2}function mH(e){return null!==e&&(e<0||32===e)}function mG(e){return -2===e||-1===e||32===e}let mK=mY(/\p{P}|\p{S}/u),mJ=mY(/\s/);function mY(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function mX(e,t,n,r){let i=r?r-1:1/0,a=0;return function(r){return mG(r)?(e.enter(n),function r(s){return mG(s)&&a++<i?(e.consume(s),r):(e.exit(n),t(s))}(r)):t(r)}}let mQ={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return mW(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},m0={tokenize:function(e){let t,n,r,i=this,a=[],s=0;return o;function o(t){if(s<a.length){let n=a[s];return i.containerState=n[1],e.attempt(n[0].continuation,l,d)(t)}return d(t)}function l(e){if(s++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&x();let r=i.events.length,a=r;for(;a--;)if("exit"===i.events[a][0]&&"chunkFlow"===i.events[a][1].type){n=i.events[a][1].end;break}g(s);let o=r;for(;o<i.events.length;)i.events[o][1].end={...n},o++;return mO(i.events,a+1,0,i.events.slice(r)),i.events.length=o,d(e)}return o(e)}function d(n){if(s===a.length){if(!t)return m(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(m1,c,u)(n)}function c(e){return t&&x(),g(s),m(e)}function u(e){return i.parser.lazy[i.now().line]=s!==a.length,r=i.now().offset,f(e)}function m(t){return i.containerState={},e.attempt(m1,p,f)(t)}function p(e){return s++,a.push([i.currentConstruct,i.containerState]),m(e)}function f(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){h(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return mW(n)?(e.consume(n),h(e.exit("chunkFlow")),s=0,i.interrupt=void 0,o):(e.consume(n),t)}(r)}function h(e,a){let o=i.sliceStream(e);if(a&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),i.parser.lazy[e.start.line]){let e,n,a=t.events.length;for(;a--;)if(t.events[a][1].start.offset<r&&(!t.events[a][1].end||t.events[a][1].end.offset>r))return;let o=i.events.length,l=o;for(;l--;)if("exit"===i.events[l][0]&&"chunkFlow"===i.events[l][1].type){if(e){n=i.events[l][1].end;break}e=!0}for(g(s),a=o;a<i.events.length;)i.events[a][1].end={...n},a++;mO(i.events,l+1,0,i.events.slice(o)),i.events.length=a}}function g(t){let n=a.length;for(;n-- >t;){let t=a[n];i.containerState=t[1],t[0].exit.call(i,e)}a.length=t}function x(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},m1={tokenize:function(e,t,n){return mX(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},m2={partial:!0,tokenize:function(e,t,n){return function(t){return mG(t)?mX(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||mW(e)?t(e):n(e)}}};class m4{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&m5(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),m5(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),m5(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);m5(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);m5(this.left,t.reverse())}}}function m5(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function m6(e){let t,n,r,i,a,s,o,l={},d=-1,c=new m4(e);for(;++d<c.length;){for(;d in l;)d=l[d];if(t=c.get(d),d&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(d-1)[1].type&&((r=0)<(s=t[1]._tokenizer.events).length&&"lineEndingBlank"===s[r][1].type&&(r+=2),r<s.length&&"content"===s[r][1].type))for(;++r<s.length&&"content"!==s[r][1].type;)"chunkText"===s[r][1].type&&(s[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(l,function(e,t){let n,r,i=e.get(t)[1],a=e.get(t)[2],s=t-1,o=[],l=i._tokenizer;!l&&(l=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let d=l.events,c=[],u={},m=-1,p=i,f=0,h=0,g=[0];for(;p;){for(;e.get(++s)[1]!==p;);o.push(s),!p._tokenizer&&(n=a.sliceStream(p),p.next||n.push(null),r&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(n),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++m<d.length;)"exit"===d[m][0]&&"enter"===d[m-1][0]&&d[m][1].type===d[m-1][1].type&&d[m][1].start.line!==d[m][1].end.line&&(h=m+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),m=g.length;m--;){let t=d.slice(g[m],g[m+1]),n=o.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),m=-1;++m<c.length;)u[f+c[m][0]]=f+c[m][1],f+=c[m][1]-c[m][0]-1;return u}(c,d)),d=l[d],o=!0);else if(t[1]._container){for(r=d,n=void 0;r--;)if("lineEnding"===(i=c.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(a=c.slice(n,d)).unshift(t),c.splice(n,d-n+1,a))}}return mO(e,0,1/0,c.slice(0)),!o}let m3={resolve:function(e){return m6(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):mW(t)?e.check(m9,a,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},m9={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,i,"linePrefix")};function i(i){if(null===i||mW(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},m8={tokenize:function(e){let t=this,n=e.attempt(m2,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,mX(e,e.attempt(this.parser.constructs.flow,r,e.attempt(m3,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},m7={resolveAll:pr()},pe=pn("string"),pt=pn("text");function pn(e){return{resolveAll:pr("text"===e?pi:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,s);return a;function a(e){return l(e)?i(e):s(e)}function s(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),o)}function l(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function pr(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function pi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],a=t.sliceStream(i),s=a.length,o=-1,l=0;for(;s--;){let e=a[s];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)l++,o--;if(o)break;o=-1}else if(-2===e)r=!0,l++;else if(-1===e);else{s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){let a={type:n===e.length||r||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-l,offset:i.end.offset-l},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}function pa(e){return null===e||mH(e)||mJ(e)?1:mK(e)?2:void 0}function ps(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}let po={name:"attention",resolveAll:function(e,t){let n,r,i,a,s,o,l,d,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let u={...e[n][1].end},m={...e[c][1].start};pl(u,-o),pl(m,o),a={type:o>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:m},i={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:o>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[n][1].end={...a.start},e[c][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=mM(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=mM(l,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=mM(l,ps(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=mM(l,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(d=2,l=mM(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):d=0,mO(e,n-1,c-n+3,l),c=n+l.length-d-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,a=pa(i);return function(s){return n=s,e.enter("attentionSequence"),function s(o){if(o===n)return e.consume(o),s;let l=e.exit("attentionSequence"),d=pa(o),c=!d||2===d&&a||r.includes(o),u=!a||2===a&&d||r.includes(i);return l._open=!!(42===n?c:c&&(a||!u)),l._close=!!(42===n?u:u&&(d||!c)),t(o)}(s)}}};function pl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let pd={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return mG(t)?mX(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(pd,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return mG(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},pc={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return mq(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},pu=document.createElement("i");function pm(e){let t="&"+e+";";pu.innerHTML=t;let n=pu.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let pp={name:"characterReference",tokenize:function(e,t,n){let r,i,a=this,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,i=mU,d(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=mV,d):(e.enter("characterReferenceValue"),r=7,i=mB,d(t))}function d(o){if(59===o&&s){let r=e.exit("characterReferenceValue");return i!==mU||pm(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return i(o)&&s++<r?(e.consume(o),d):n(o)}}},pf={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},ph={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),mG(t)?mX(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(a++,e.consume(i),t):a>=o?(e.exit("codeFencedFenceSequence"),mG(i)?mX(e,d,"whitespace")(i):d(i)):n(i)}(t)):n(t)}function d(r){return null===r||mW(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},s=0,o=0;return function(t){var a;let d;return a=t,s=(d=i.events[i.events.length-1])&&"linePrefix"===d[1].type?d[2].sliceSerialize(d[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o<3?n(i):(e.exit("codeFencedFenceSequence"),mG(i)?mX(e,l,"whitespace")(i):l(i))}(a)};function l(a){return null===a||mW(a)?(e.exit("codeFencedFence"),i.interrupt?t(a):e.check(pf,c,f)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||mW(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(i)):mG(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mX(e,d,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(a))}function d(t){return null===t||mW(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||mW(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function c(t){return e.attempt(a,f,u)(t)}function u(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return s>0&&mG(t)?mX(e,p,"linePrefix",s+1)(t):p(t)}function p(t){return null===t||mW(t)?e.check(pf,c,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||mW(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},pg={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),mX(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?a(n):mW(n)?e.attempt(px,t,a)(n):(e.enter("codeFlowValue"),function n(r){return null===r||mW(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function a(n){return e.exit("codeIndented"),t(n)}}},px={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):mX(e,a,"linePrefix",5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):mW(e)?i(e):n(e)}}};function pv(e,t,n,r,i,a,s,o,l){let d=l||1/0,c=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),u):null===t||32===t||41===t||mF(t)?n(t):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(n))}function m(t){return 62===t?(e.exit("chunkString"),e.exit(o),u(t)):null===t||60===t||mW(t)?n(t):(e.consume(t),92===t?p:m)}function p(t){return 60===t||62===t||92===t?(e.consume(t),m):m(t)}function f(i){return!c&&(null===i||41===i||mH(i))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(i)):c<d&&40===i?(e.consume(i),c++,f):41===i?(e.consume(i),c--,f):null===i||32===i||40===i||mF(i)?n(i):(e.consume(i),92===i?h:f)}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function py(e,t,n,r,i,a){let s,o=this,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),d};function d(u){return l>999||null===u||91===u||93===u&&!s||94===u&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(u):93===u?(e.exit(a),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):mW(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||mW(t)||l++>999?(e.exit("chunkString"),d(t)):(e.consume(t),s||(s=!mG(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function pb(e,t,n,r,i,a){let s;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),s=40===t?41:t,o):n(t)};function o(n){return n===s?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===s?(e.exit(a),o(s)):null===t?n(t):mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return t===s||null===t||mW(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:d)}function c(t){return t===s||92===t?(e.consume(t),d):d(t)}}function pk(e,t){let n;return function r(i){return mW(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mG(i)?mX(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function pj(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let pw={partial:!0,tokenize:function(e,t,n){return function(t){return mH(t)?pk(e,r)(t):n(t)};function r(t){return pb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return mG(t)?mX(e,a,"whitespace")(t):a(t)}function a(e){return null===e||mW(e)?t(e):n(e)}}},pN=["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"],p_=["pre","script","style","textarea"],pS={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(m2,t,n)}}},p$={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},pI={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&mO(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,a,s=e.length,o=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(i=s);let l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[i-2][1].start}};return a=mM(a=[["enter",l,t],["enter",d,t]],e.slice(r+1,r+o+3)),a=mM(a,[["enter",c,t]]),a=mM(a,ps(t.parser.constructs.insideSpan.null,e.slice(r+o+4,i-3),t)),a=mM(a,[["exit",c,t],e[i-2],e[i-1],["exit",d,t]]),a=mM(a,e.slice(i+1)),a=mM(a,[["exit",l,t]]),mO(e,r,e.length,a),e},tokenize:function(e,t,n){let r,i,a=this,s=a.events.length;for(;s--;)if(("labelImage"===a.events[s][1].type||"labelLink"===a.events[s][1].type)&&!a.events[s][1]._balanced){r=a.events[s][1];break}return function(t){return r?r._inactive?c(t):(i=a.parser.defined.includes(pj(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(pE,d,i?d:c)(t):91===t?e.attempt(pC,d,i?l:c)(t):i?d(t):c(t)}function l(t){return e.attempt(pA,d,c)(t)}function d(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},pE={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return mH(t)?pk(e,i)(t):i(t)}function i(t){return 41===t?d(t):pv(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return mH(t)?pk(e,o)(t):d(t)}function s(e){return n(e)}function o(t){return 34===t||39===t||40===t?pb(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):d(t)}function l(t){return mH(t)?pk(e,d)(t):d(t)}function d(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},pC={tokenize:function(e,t,n){let r=this;return function(t){return py.call(r,e,i,a,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(pj(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},pA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},pT={name:"labelStartImage",resolveAll:pI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},pP={name:"labelStartLink",resolveAll:pI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},pz={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),mX(e,t,"linePrefix")}}},pO={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(a){var s;return e.enter("thematicBreak"),r=s=a,function a(s){return s===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),mG(n)?mX(e,a,"whitespace")(n):a(n))}(s)):i>=3&&(null===s||mW(s))?(e.exit("thematicBreak"),t(s)):n(s)}(s)}}},pM={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(m2,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mX(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!mG(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pD,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,mX(e,e.attempt(pM,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,s=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:mB(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(pO,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return mB(i)&&++s<10?(e.consume(i),t):(!r.interrupt||s<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),o(i)):n(i)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(m2,r.interrupt?n:l,e.attempt(pR,c,d))}function l(e){return r.containerState.initialBlankLine=!0,a++,c(e)}function d(t){return mG(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},pR={partial:!0,tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return!mG(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},pD={partial:!0,tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},pL={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);let s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var s;let o,l=i.events.length;for(;l--;)if("lineEnding"!==i.events[l][1].type&&"linePrefix"!==i.events[l][1].type&&"content"!==i.events[l][1].type){o="paragraph"===i.events[l][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||o)?(e.enter("setextHeadingLine"),r=t,s=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),mG(n)?mX(e,a,"lineSuffix")(n):a(n))}(s)):n(t)};function a(r){return null===r||mW(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,py.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function a(t){return(r=pj(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return mH(t)?pk(e,o)(t):o(t)}function o(t){return pv(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(pw,d,d)(t)}function d(t){return mG(t)?mX(e,c,"whitespace")(t):c(t)}function c(a){return null===a||mW(a)?(e.exit("definition"),i.parser.defined.push(r),t(a)):n(a)}}}},"disable",0,{null:[]},"document",0,{42:pM,43:pM,45:pM,48:pM,49:pM,50:pM,51:pM,52:pM,53:pM,54:pM,55:pM,56:pM,57:pM,62:pd},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;return"whitespace"===e[3][1].type&&(a+=2),i-2>a&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4),i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},mO(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var a;return e.enter("atxHeading"),a=i,e.enter("atxHeadingSequence"),function i(a){return 35===a&&r++<6?(e.consume(a),i):null===a||mH(a)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||mW(r)?(e.exit("atxHeading"),t(r)):mG(r)?mX(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||mH(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(a)):n(a)}(a)}}},42:pO,45:[pL,pO],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,a,s,o,l=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),d};function d(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,p):63===s?(e.consume(s),r=3,l.interrupt?t:T):mL(s)?(e.consume(s),a=String.fromCharCode(s),f):n(s)}function c(i){return 45===i?(e.consume(i),r=2,u):91===i?(e.consume(i),r=5,s=0,m):mL(i)?(e.consume(i),r=4,l.interrupt?t:T):n(i)}function u(r){return 45===r?(e.consume(r),l.interrupt?t:T):n(r)}function m(r){let i="CDATA[";return r===i.charCodeAt(s++)?(e.consume(r),s===i.length)?l.interrupt?t:N:m:n(r)}function p(t){return mL(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||mH(s)){let o=47===s,d=a.toLowerCase();return!o&&!i&&p_.includes(d)?(r=1,l.interrupt?t(s):N(s)):pN.includes(a.toLowerCase())?(r=6,o)?(e.consume(s),h):l.interrupt?t(s):N(s):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(s):i?function t(n){return mG(n)?(e.consume(n),t):j(n)}(s):g(s))}return 45===s||mU(s)?(e.consume(s),a+=String.fromCharCode(s),f):n(s)}function h(r){return 62===r?(e.consume(r),l.interrupt?t:N):n(r)}function g(t){return 47===t?(e.consume(t),j):58===t||95===t||mL(t)?(e.consume(t),x):mG(t)?(e.consume(t),g):j(t)}function x(t){return 45===t||46===t||58===t||95===t||mU(t)?(e.consume(t),x):v(t)}function v(t){return 61===t?(e.consume(t),y):mG(t)?(e.consume(t),v):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,b):mG(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||mH(n)?v(n):(e.consume(n),t)}(t)}function b(t){return t===o?(e.consume(t),o=null,k):null===t||mW(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||mG(e)?g(e):n(e)}function j(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||mW(t)?N(t):mG(t)?(e.consume(t),w):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),I):60===t&&1===r?(e.consume(t),E):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),T):93===t&&5===r?(e.consume(t),A):mW(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(pS,z,_)(t)):null===t||mW(t)?(e.exit("htmlFlowData"),_(t)):(e.consume(t),N)}function _(t){return e.check(p$,S,z)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),$}function $(t){return null===t||mW(t)?_(t):(e.enter("htmlFlowData"),N(t))}function I(t){return 45===t?(e.consume(t),T):N(t)}function E(t){return 47===t?(e.consume(t),a="",C):N(t)}function C(t){if(62===t){let n=a.toLowerCase();return p_.includes(n)?(e.consume(t),P):N(t)}return mL(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),C):N(t)}function A(t){return 93===t?(e.consume(t),T):N(t)}function T(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),T):N(t)}function P(t){return null===t||mW(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),P)}function z(n){return e.exit("htmlFlow"),t(n)}}},61:pL,95:pO,96:ph,126:ph},"flowInitial",0,{[-2]:pg,[-1]:pg,32:pg},"insideSpan",0,{null:[po,m7]},"string",0,{38:pp,92:pc},"text",0,{[-5]:pz,[-4]:pz,[-3]:pz,33:pT,38:pp,42:po,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return mL(t)?(e.consume(t),a):64===t?n(t):o(t)}function a(t){return 43===t||45===t||46===t||mU(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,s):(43===n||45===n||46===n||mU(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||mF(r)?n(r):(e.consume(r),s)}function o(t){return 64===t?(e.consume(t),l):mZ(t)?(e.consume(t),o):n(t)}function l(i){return mU(i)?function i(a){return 46===a?(e.consume(a),r=0,l):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(a){if((45===a||mU(a))&&r++<63){let n=45===a?t:i;return e.consume(a),n}return n(a)}(a)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,a,s=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),v):mL(t)?(e.consume(t),j):n(t)}function l(t){return 45===t?(e.consume(t),d):91===t?(e.consume(t),i=0,p):mL(t)?(e.consume(t),x):n(t)}function d(t){return 45===t?(e.consume(t),m):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):mW(t)?(a=c,C(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),m):c(t)}function m(e){return 62===e?E(e):45===e?u(e):c(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):mW(t)?(a=f,C(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?E(t):93===t?(e.consume(t),g):f(t)}function x(t){return null===t||62===t?E(t):mW(t)?(a=x,C(t)):(e.consume(t),x)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):mW(t)?(a=v,C(t)):(e.consume(t),v)}function y(e){return 62===e?E(e):v(e)}function b(t){return mL(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||mU(t)?(e.consume(t),k):function t(n){return mW(n)?(a=t,C(n)):mG(n)?(e.consume(n),t):E(n)}(t)}function j(t){return 45===t||mU(t)?(e.consume(t),j):47===t||62===t||mH(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),E):58===t||95===t||mL(t)?(e.consume(t),N):mW(t)?(a=w,C(t)):mG(t)?(e.consume(t),w):E(t)}function N(t){return 45===t||46===t||58===t||95===t||mU(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),_):mW(n)?(a=t,C(n)):mG(n)?(e.consume(n),t):w(n)}(t)}function _(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,S):mW(t)?(a=_,C(t)):mG(t)?(e.consume(t),_):(e.consume(t),$)}function S(t){return t===r?(e.consume(t),r=void 0,I):null===t?n(t):mW(t)?(a=S,C(t)):(e.consume(t),S)}function $(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||mH(t)?w(t):(e.consume(t),$)}function I(e){return 47===e||62===e||mH(e)?w(e):n(e)}function E(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function C(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return mG(t)?mX(e,T,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):T(t)}function T(t){return e.enter("htmlTextData"),a(t)}}}],91:pP,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return mW(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},pc],93:pI,95:po,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,a=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),a++,t):(e.exit("codeTextSequence"),s(n))}(t)};function s(l){return null===l?n(l):32===l?(e.enter("space"),e.consume(l),e.exit("space"),s):96===l?(i=e.enter("codeTextSequence"),r=0,function n(s){return 96===s?(e.consume(s),r++,n):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(s)):(i.type="codeTextData",o(s))}(l)):mW(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):(e.enter("codeTextData"),o(l))}function o(t){return null===t||32===t||96===t||mW(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),o)}}}}],19210);var pU=e.i(19210);let pZ=/[\0\t\n\r]/g;function pF(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let pB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pV(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return pF(n.slice(t?2:1),t?16:10)}return pm(n)||e}let pq={}.hasOwnProperty;function pW(e){return{line:e.line,column:e.column,offset:e.offset}}function pH(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+mm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mm({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+mm({start:t.start,end:t.end})+") is still open")}function pG(e){let t=this;t.parser=function(n){var r,i;let a,s,o,l;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:d,autolinkEmail:d,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:d,characterReference:d,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:d,data:d,codeFlowValue:d,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(h),hardBreakTrailing:r(h),htmlFlow:r(g,i),htmlFlowData:d,htmlText:r(g,i),htmlTextData:d,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:s(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=pF(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=pm(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=pW(e.end)},codeFenced:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:s(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pj(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(u),hardBreakTrailing:s(u),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(pB,pV),n.identifier=pj(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=pW(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(d.call(this,e),c.call(this,e))},link:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:s(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:s(),thematicBreak:s()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(pq.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},s={stack:[r],tokenStack:[],config:t,enter:a,exit:o,buffer:i,resume:l,data:n},d=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?d.push(c):c=function(e,t,n){let r,i,a,s,o=t-1,l=-1,d=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,s=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||s||l||a||(a=o),s=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:s=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=o;for(i=void 0;s--;){let t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",d=!0),t[1].type="lineEnding",i=s}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}a&&(!i||a<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(o,0,["enter",i,t[2]]),o++,n++,a=void 0,s=!0}}}return e[t][1]._spread=d,n}(e,d.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];pq.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},s),e[c][1])}if(s.tokenStack.length>0){let e=s.tokenStack[s.tokenStack.length-1];(e[1]||pH).call(s,void 0,e[0])}for(r.position={start:pW(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:pW(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:pW(t.start),end:void 0}}function s(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||pH).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+mm({start:e.start,end:e.end})+"): it’s not open");n.position.end=pW(e.end)}function l(){return mT(this.stack.pop())}function d(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:pW(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=pW(e.end)}function u(){this.data.atHardBreak=!0}function m(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function h(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!m6(e););return e}((function(e){let t={constructs:mD([pU,...(e||{}).extensions||[]]),content:n(mQ),defined:[],document:n(m0),flow:n(m8),lazy:{},string:n(pe),text:n(pt)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],s=[],o=[],l={attempt:f(function(e,t){h(e,t.from)}),check:f(p),consume:function(e){mW(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=m(),d.events.push(["enter",n,d]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=m(),d.events.push(["exit",t,d]),t},interrupt:f(p,{interrupt:!0})},d={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:m,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let a,s=e[r];if("string"==typeof s)a=s;else switch(s){case -5:a="\r";break;case -4:a="\n";break;case -3:a="\r\n";break;case -2:a=t?" ":" ";break;case -1:if(!t&&n)continue;a=" ";break;default:a=String.fromCharCode(s)}n=-2===s,i.push(a)}return i.join("")}(u(e),t)},sliceStream:u,write:function(e){return(s=mM(s,e),function(){let e;for(;r._index<s.length;){let n=s[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==s[s.length-1])?[]:(h(t,0),d.events=ps(a,d.events,d),d.events)}},c=t.tokenize.call(d,l);return t.resolveAll&&a.push(t),d;function u(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;if(r===a)n=[e[r].slice(i,s)];else{if(n=e.slice(r,a),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}s>0&&n.push(e[a].slice(0,s))}return n}(s,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function p(e,t){t.restore()}function f(e,t){return function(n,i,a){var s;let c,u,p,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):(s=n,function(e){let t=null!==e&&s[e],n=null!==e&&s.null;return h([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function h(e){return(c=e,u=0,0===e.length)?a:x(e[u])}function x(e){return function(n){let i,a,s,c,u;return(i=m(),a=d.previous,s=d.currentConstruct,c=d.events.length,u=Array.from(o),f={from:c,restore:function(){r=i,d.previous=a,d.currentConstruct=s,d.events.length=c,o=u,g()}},p=e,e.partial||(d.currentConstruct=e),e.name&&d.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(d),t):d,l,v,y)(n)}}function v(t){return e(p,f),i}function y(e){return(f.restore(),++u<c.length)?x(c[u]):a}}}function h(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&mO(d.events,t,d.events.length-t,e.resolve(d.events.slice(t),d)),e.resolveTo&&(d.events=e.resolveTo(d.events,d))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((s=1,o="",l=!0,function(e,t,n){let r,i,d,c,u,m=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),d=0,o="",l&&(65279===e.charCodeAt(0)&&d++,l=void 0);d<e.length;){if(pZ.lastIndex=d,c=(r=pZ.exec(e))&&void 0!==r.index?r.index:e.length,u=e.charCodeAt(c),!r){o=e.slice(d);break}if(10===u&&d===c&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),d<c&&(m.push(e.slice(d,c)),s+=c-d),u){case 0:m.push(65533),s++;break;case 9:for(i=4*Math.ceil(s/4),m.push(-2);s++<i;)m.push(-1);break;case 10:m.push(-4),s=1;break;default:a=!0,s=1}d=c+1}return n&&(a&&m.push(-5),o&&m.push(o),m.push(null)),m})(n,r,!0))))}}let pK="object"==typeof self?self:globalThis,pJ=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+e)}return new pK[e](t)},pY=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[a,s]=e[i];switch(a){case 0:case -1:return n(s,i);case 1:{let e=n([],i);for(let t of s)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of s)e[r(t)]=r(n);return e}case 3:return n(new Date(s),i);case 4:{let{source:e,flags:t}=s;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of s)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of s)e.add(r(t));return e}case 7:{let{name:e,message:t}=s;return n(pJ(e,t),i)}case 8:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return n(new DataView(e),s)}}return n(pJ(a,s),i)})(0)},{toString:pX}={},{keys:pQ}=Object,p0=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=pX.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},p1=([e,t])=>0===e&&("function"===t||"symbol"===t),p2=(e,{json:t,lossy:n}={})=>{var r,i,a;let s,o,l=[];return(r=!(t||n),i=!!t,a=new Map,s=(e,t)=>{let n=l.push(e)-1;return a.set(t,n),n},o=e=>{if(a.has(e))return a.get(e);let[t,n]=p0(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return s([-1],e)}return s([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),s([n,[...t]],e)}let r=[],i=s([t,r],e);for(let t of e)r.push(o(t));return i}case 2:{if(n)switch(n){case"BigInt":return s([n,e.toString()],e);case"Boolean":case"Number":case"String":return s([n,e.valueOf()],e)}if(i&&"toJSON"in e)return o(e.toJSON());let a=[],l=s([t,a],e);for(let t of pQ(e))(r||!p1(p0(e[t])))&&a.push([o(t),o(e[t])]);return l}case 3:return s([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return s([t,{source:n,flags:r}],e)}case 5:{let n=[],i=s([t,n],e);for(let[t,i]of e)(r||!(p1(p0(t))||p1(p0(i))))&&n.push([o(t),o(i)]);return i}case 6:{let n=[],i=s([t,n],e);for(let t of e)(r||!p1(p0(t)))&&n.push(o(t));return i}}let{message:l}=e;return s([t,{name:n,message:l}],e)})(e),l},p4="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?pY(p2(e,t)):structuredClone(e):(e,t)=>pY(p2(e,t));function p5(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),s="";if(37===a&&mU(e.charCodeAt(n+1))&&mU(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(s=String.fromCharCode(a,t),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function p6(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function p3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let p9=function(e){var t,n;if(null==e)return p7;if("function"==typeof e)return p8(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=p9(e[n]);return p8(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,p8(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,p8(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function p8(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function p7(){return!0}let fe=[];function ft(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let a=p9(i),s=r?-1:1;(function e(i,o,l){let d=i&&"object"==typeof i?i:{};if("string"==typeof d.type){let e="string"==typeof d.tagName?d.tagName:"string"==typeof d.name?d.name:void 0;Object.defineProperty(c,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return c;function c(){var d;let c,u,m,p=fe;if((!t||a(i,o,l[l.length-1]||void 0))&&!1===(p=Array.isArray(d=n(i,l))?d:"number"==typeof d?[!0,d]:null==d?fe:[d])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(u=(r?i.children.length:-1)+s,m=l.concat(i);u>-1&&u<i.children.length;){if(!1===(c=e(i.children[u],u,m)())[0])return c;u="number"==typeof c[1]?c[1]:u+s}return p}})(e,void 0,[])()}function fn(e,t,n,r){let i,a,s;"function"==typeof t&&"function"!=typeof n?(a=void 0,s=t,i=n):(a=t,s=n,i=r),ft(e,a,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return s(e,r,n)},i)}function fr(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),a=i[0];a&&"text"===a.type?a.value="["+a.value:i.unshift({type:"text",value:"["});let s=i[i.length-1];return s&&"text"===s.type?s.value+=r:i.push({type:"text",value:r}),i}function fi(e){let t=e.spread;return null==t?e.children.length>1:t}function fa(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let fs={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=p5(i.toLowerCase()),s=e.footnoteOrder.indexOf(i),o=e.footnoteCounts.get(i);void 0===o?(o=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=s+1,o+=1,e.footnoteCounts.set(i,o);let l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,l);let d={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,d),e.applyData(t,d)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fr(e,t);let i={src:p5(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){let n={src:p5(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fr(e,t);let i={href:p5(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){let n={href:p5(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=fi(n[r])}return t}(n):fi(t),a={},s=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(i||0!==o||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?s.push(e):s.push(...e.children)}let l=r[r.length-1];l&&(i||"element"!==l.type||"p"!==l.tagName)&&s.push({type:"text",value:"\n"});let d={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,d),e.applyData(t,d)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=mc(t.children[1]),s=md(t.children[t.children.length-1]);a&&s&&(r.position={start:a,end:s}),i.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,s=a?a.length:t.children.length,o=-1,l=[];for(;++o<s;){let n=t.children[o],r={},s=a?a[o]:void 0;s&&(r.align=s);let d={type:"element",tagName:i,properties:r,children:[]};n&&(d.children=e.all(n),e.patch(n,d),d=e.applyData(n,d)),l.push(d)}let d={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,d),e.applyData(t,d)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(fa(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(fa(t.slice(i),i>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:fo,yaml:fo,definition:fo,footnoteDefinition:fo};function fo(){}let fl={}.hasOwnProperty,fd={};function fc(e,t){e.position&&(t.position=function(e){let t=mc(e),n=md(e);if(t&&n)return{start:t,end:n}}(e))}function fu(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,p4(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function fm(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function fp(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ff(e,t){let n,r,i,a,s=(n=t||fd,r=new Map,i=new Map,a={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=fp(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=fp(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:fu,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...fs,...n.handlers},one:function(e,t){let n=e.type,r=a.handlers[n];if(fl.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=p4(n);return r.children=a.all(e),r}return p4(e)}return(a.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(fl.call(n,"hProperties")||fl.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(a,e,t)},options:n,patch:fc,wrap:fm},fn(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a),o=s.one(e,void 0),l=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||p6,r=e.options.footnoteBackLabel||p3,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],l=-1;for(;++l<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;let a=e.all(i),s=String(i.identifier).toUpperCase(),d=p5(s.toLowerCase()),c=0,u=[],m=e.footnoteCounts.get(s);for(;void 0!==m&&++c<=m;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else a.push(...u);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(a,!0)};e.patch(i,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...p4(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(s),d=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return l&&(uA("children"in d),d.children.push({type:"text",value:"\n"},l)),d}function fh(e,t){return e&&"run"in e?async function(n,r){let i=ff(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ff(n,{file:r,...e||t})}}function fg(e){if(e)throw e}var fx=e.i(75609);function fv(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let fy=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');fw(e);let r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else s<0&&(n=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(i=a):(o=-1,i=s));return r===i?i=s:i<0&&(i=e.length),e.slice(r,i)},fb=function(e){let t;if(fw(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},fk=function(e){let t;fw(e);let n=e.length,r=-1,i=0,a=-1,s=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?a<0?a=n:1!==s&&(s=1):a>-1&&(s=-1)}return a<0||r<0||0===s||1===s&&a===r-1&&a===i+1?"":e.slice(a,r)},fj=function(...e){var t;let n,r,i,a=-1;for(;++a<e.length;)fw(e[a]),e[a]&&(i=void 0===i?e[a]:i+"/"+e[a]);return void 0===i?".":(fw(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",a=0,s=-1,o=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else if(47===n)break;else n=47;if(47===n){if(s===l-1||1===o);else if(s!==l-1&&2===o){if(i.length<2||2!==a||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",a=0):a=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),s=l,o=0;continue}}else if(i.length>0){i="",a=0,s=l,o=0;continue}}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,l):i=e.slice(s+1,l),a=l-s-1;s=l,o=0}else 46===n&&o>-1?o++:o=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function fw(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function fN(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let f_=["history","path","basename","stem","extname","dirname"];class fS{constructor(e){let t,n;t=e?fN(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<f_.length;){const e=f_[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)f_.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?fy(this.path):void 0}set basename(e){fI(e,"basename"),f$(e,"basename"),this.path=fj(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?fb(this.path):void 0}set dirname(e){fE(this.basename,"dirname"),this.path=fj(e||"",this.basename)}get extname(){return"string"==typeof this.path?fk(this.path):void 0}set extname(e){if(f$(e,"extname"),fE(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=fj(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){fN(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!fN(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),fI(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?fy(this.path,this.extname):void 0}set stem(e){fI(e,"stem"),f$(e,"stem"),this.path=fj(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new mg(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function f$(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function fI(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function fE(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let fC=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},fA={}.hasOwnProperty;class fT extends fC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(a,...s){let o=e[++n],l=-1;if(a)return void r(a);for(;++l<t.length;)(null===s[l]||void 0===s[l])&&(s[l]=t[l]);t=s,o?(function(e,t){let n;return function(...t){let a,s=e.length>t.length;s&&t.push(r);try{a=e.apply(this,t)}catch(e){if(s&&n)throw e;return r(e)}s||(a&&a.then&&"function"==typeof a.then?a.then(i,r):a instanceof Error?r(a):i(a))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(o,i)(...s):r(null,...s)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new fT,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,fx.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(fM("data",this.frozen),this.namespace[e]=t,this):fA.call(this.namespace,e)&&this.namespace[e]||void 0:e?(fM("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=fL(e),n=this.parser||this.Parser;return fz("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fz("process",this.parser||this.Parser),fO("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=fL(e),s=n.parse(a);function o(e,n){e||!n?i(e):r?r(n):(uA(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(s,a,function(e,t,r){var i,a;if(e||!t||!r)return o(e);let s=n.stringify(t,r);"string"==typeof(i=s)||(a=i)&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=s:r.result=s,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),fz("processSync",this.parser||this.Parser),fO("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,fg(e),t=r}),fD("processSync","process",n),uA(t,"we either bailed on an error or have a tree"),t}run(e,t,n){fR(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){uA("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let s=fL(t);r.run(e,s,function(t,r,s){let o=r||e;t?a(t):i?i(o):(uA(n,"`done` is defined if `resolve` is not"),n(void 0,o,s))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){fg(e),n=t,r=!0}),fD("runSync","run",r),uA(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=fL(t),r=this.compiler||this.Compiler;return fO("stringify",r),fR(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(fM("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else if("object"==typeof e)Array.isArray(e)?a(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=(0,fx.default)(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)s(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,s=n[i][1];fv(s)&&fv(r)&&(r=(0,fx.default)(!0,s,r)),n[i]=[e,r,...a]}}}}let fP=new fT().freeze();function fz(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function fO(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function fM(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fR(e){if(!fv(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function fD(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function fL(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new fS(e)}let fU=[],fZ={allowDangerousHtml:!0},fF=/^(https?|ircs?|mailto|xmpp)$/i,fB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fV(e){var t;let n,r,i,a,s,o=(n=(t=e).rehypePlugins||fU,r=t.remarkPlugins||fU,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...fZ}:fZ,fP().use(pG).use(r).use(fh,i).use(n)),l=(a=e.children||"",s=new fS,"string"==typeof a?s.value=a:uT("Unexpected value `"+a+"` for `children` prop, expected `string`"),s);return function(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||fq;for(let e of fB)Object.hasOwn(t,e.from)&&uT("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return n&&a&&uT("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),fn(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return s?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in mC)if(Object.hasOwn(mC,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=mC[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let s=n?!n.includes(e.tagName):!!a&&a.includes(e.tagName);if(!s&&r&&"number"==typeof t&&(s=!r(e,t,i)),s&&i&&"number"==typeof t)return o&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}),function(e,t){var n,r,i,a;let s;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,s=function(e,t,i,a){let s=Array.isArray(i.children),o=mc(e);return r(t,i,a,s,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,a=t.jsxs,s=function(e,t,n,r){let s=Array.isArray(n.children)?a:i;return r?s(t,n,r):s(t,n)}}let l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?mo:ms,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},d=mw(l,e,void 0);return d&&"string"!=typeof d?d:l.create(e,l.Fragment,{children:d||void 0},void 0)}(e,{Fragment:eT.Fragment,components:i,ignoreInvalidStyle:!0,jsx:eT.jsx,jsxs:eT.jsxs,passKeys:!0,passNode:!0})}(o.runSync(o.parse(l),l),e)}function fq(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||fF.test(e.slice(0,t))?e:""}function fW(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let fH="phrasing",fG=["autolink","link","image","label"];function fK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function fJ(e){this.config.enter.autolinkProtocol.call(this,e)}function fY(e){this.config.exit.autolinkProtocol.call(this,e)}function fX(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];uA("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function fQ(e){this.config.exit.autolinkEmail.call(this,e)}function f0(e){this.exit(e)}function f1(e){!function(e,t,n){let r=p9((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),a=-1;for(;++a<i.length;)ft(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){let e=t[s],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[a][0],s=i[a][1],o=0,l=n.children.indexOf(e),d=!1,c=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){let n=u.index,i={index:u.index,input:u.input,stack:[...t,e]},a=s(...u,i);if("string"==typeof a&&(a=a.length>0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(o!==n&&c.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(a)?c.push(...a):a&&c.push(a),o=n+u[0].length,d=!0),!r.global)break;u=r.exec(e.value)}return d?(o<e.value.length&&c.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...c)):c=[e],l+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,f2],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,f4]],{ignore:["link","linkReference"]})}function f2(e,t,n,r,i){let a,s="";if(!f5(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",s="http://"),(a=n.split(".")).length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))return!1;let o=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=fW(e,"("),a=fW(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),a++;return[e,n]}(n+r);if(!o[0])return!1;let l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function f4(e,t,n,r){return!(!f5(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function f5(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||mJ(n)||mK(n))&&(!t||47!==n)}function f6(){this.buffer()}function f3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function f9(){this.buffer()}function f8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function f7(e){let t=this.resume(),n=this.stack[this.stack.length-1];uA("footnoteReference"===n.type),n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function he(e){this.exit(e)}function ht(e){let t=this.resume(),n=this.stack[this.stack.length-1];uA("footnoteDefinition"===n.type),n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hn(e){this.exit(e)}function hr(e,t,n,r){let i=n.createTracker(r),a=i.move("[^"),s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]")}function hi(e,t,n){return 0===t?e:ha(e,t,n)}function ha(e,t,n){return(n?"":" ")+e}hr.peek=function(){return"["};let hs=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function ho(e){this.enter({type:"delete",children:[]},e)}function hl(e){this.exit(e)}function hd(e,t,n,r){let i=n.createTracker(r),a=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function hc(e){return e.length}function hu(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}hd.peek=function(){return"~"};function hm(e,t,n){let r=e.value||"",i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){let e,t=n.unsafe[a],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}hm.peek=function(){return"`"};p9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let hp=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),a=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(a=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let s=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));let o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);let l=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?a:a+" ".repeat(s-a.length))+e});return l(),d};function hf(e){let t=e._align;uA(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function hh(e){this.exit(e),this.data.inTable=void 0}function hg(e){this.enter({type:"tableRow",children:[]},e)}function hx(e){this.exit(e)}function hv(e){this.enter({type:"tableCell",children:[]},e)}function hy(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,hb));let n=this.stack[this.stack.length-1];uA("inlineCode"===n.type),n.value=t,this.exit(e)}function hb(e,t){return"|"===t?t:e}function hk(e){let t=this.stack[this.stack.length-2];uA("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function hj(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];uA("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,a=-1;for(;++a<i.length;){let e=i[a];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hw(e,t,n,r){let i=e.children[0],a="boolean"==typeof e.checked&&i&&"paragraph"===i.type,s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let l=hp(e,t,n,{...r,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}let hN={tokenize:function(e,t,n){let r=0;return function t(a){return(87===a||119===a)&&r<3?(r++,e.consume(a),t):46===a&&3===r?(e.consume(a),i):n(a)};function i(e){return null===e?n(e):t(e)}},partial:!0},h_={tokenize:function(e,t,n){let r,i,a;return s;function s(t){return 46===t||95===t?e.check(h$,l,o)(t):null===t||mH(t)||mJ(t)||45!==t&&mK(t)?l(t):(a=!0,e.consume(t),s)}function o(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),s}function l(e){return i||r||!a?n(e):t(e)}},partial:!0},hS={tokenize:function(e,t){let n=0,r=0;return i;function i(s){return 40===s?(n++,e.consume(s),i):41===s&&r<n?a(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(h$,t,a)(s):null===s||mH(s)||mJ(s)?t(s):(e.consume(s),i)}function a(t){return 41===t&&r++,e.consume(t),i}},partial:!0},h$={tokenize:function(e,t,n){return r;function r(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),r):38===s?(e.consume(s),a):93===s?(e.consume(s),i):60===s||null===s||mH(s)||mJ(s)?t(s):n(s)}function i(e){return null===e||40===e||91===e||mH(e)||mJ(e)?t(e):r(e)}function a(t){return mL(t)?function t(i){return 59===i?(e.consume(i),r):mL(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},hI={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return mU(e)?n(e):t(e)}},partial:!0},hE={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!hz.call(r,r.previous)||hD(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hN,e.attempt(h_,e.attempt(hS,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:hz},hC={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",a=!1;return function(t){return(72===t||104===t)&&hO.call(r,r.previous)&&!hD(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),s):n(t)};function s(t){if(mL(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),a)?l:(a=!0,o):n(t)}function l(t){return null===t||mF(t)||mH(t)||mJ(t)||mK(t)?n(t):e.attempt(h_,e.attempt(hS,d),n)(t)}function d(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:hO},hA={name:"emailAutolink",tokenize:function(e,t,n){let r,i,a=this;return function(t){return!hR(t)||!hM.call(a,a.previous)||hD(a.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return hR(r)?(e.consume(r),t):64===r?(e.consume(r),s):n(r)}(t))};function s(t){return 46===t?e.check(hI,l,o)(t):45===t||95===t||mU(t)?(i=!0,e.consume(t),s):l(t)}function o(t){return e.consume(t),r=!0,s}function l(s){return i&&r&&mL(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:hM},hT={},hP=48;for(;hP<123;)hT[hP]=hA,58==++hP?hP=65:91===hP&&(hP=97);function hz(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||mH(e)}function hO(e){return!mL(e)}function hM(e){return!(47===e||hR(e))}function hR(e){return 43===e||45===e||46===e||95===e||mU(e)}function hD(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}hT[43]=hA,hT[45]=hA,hT[46]=hA,hT[95]=hA,hT[72]=[hA,hC],hT[104]=[hA,hC],hT[87]=[hA,hE],hT[119]=[hA,hE];let hL={tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function hU(e,t,n){let r,i=this,a=i.events.length,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;a--;){let e=i.events[a][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(a){if(!r||!r._balanced)return n(a);let o=pj(i.sliceSerialize({start:r.end,end:i.now()}));return 94===o.codePointAt(0)&&s.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a)):n(a)}}function hZ(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function hF(e,t,n){let r,i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(s>999||93===o&&!r||null===o||91===o||mH(o))return n(o);if(93===o){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return a.includes(pj(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return mH(o)||(r=!0),s++,e.consume(o),92===o?d:l}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function hB(e,t,n){let r,i,a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(t)}function d(t){if(o>999||93===t&&!i||null===t||91===t||mH(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=pj(a.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return mH(t)||(i=!0),o++,e.consume(t),92===t?c:d}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,d):d(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(r)||s.push(r),mX(e,m,"gfmFootnoteDefinitionWhitespace")):n(t)}function m(e){return t(e)}}function hV(e,t,n){return e.check(m2,t,e.attempt(hL,t,n))}function hq(e){e.exit("gfmFootnoteDefinition")}class hW{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function hH(e,t,n){let r,i=this,a=0,s=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,a="tableHead"===r||"tableRow"===r?v:o;return a===v&&i.parser.lazy[i.now().line]?n(e):a(e)};function o(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,s+=1),l(n)}function l(t){return null===t?n(t):mW(t)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):mG(t)?mX(e,l,"whitespace")(t):(s+=1,r&&(r=!1,a+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l):(e.enter("data"),d(t))}function d(t){return null===t||124===t||mH(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?c:d)}function c(t){return 92===t||124===t?(e.consume(t),d):d(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,mG(t))?mX(e,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):m(t)}function m(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return mG(t)?mX(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(s+=1,h(t)):null===t||mW(t)?x(t):n(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return mG(t)?mX(e,x,"whitespace")(t):x(t)}function x(i){if(124===i)return m(i);if(null===i||mW(i))return r&&a===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function v(t){return e.enter("tableRow"),y(t)}function y(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),y):null===n||mW(n)?(e.exit("tableRow"),t(n)):mG(n)?mX(e,y,"whitespace")(n):(e.enter("data"),b(n))}function b(t){return null===t||124===t||mH(t)?(e.exit("data"),y(t)):(e.consume(t),92===t?k:b)}function k(t){return 92===t||124===t?(e.consume(t),b):b(t)}}function hG(e,t){let n,r,i,a=-1,s=!0,o=0,l=[0,0,0,0],d=[0,0,0,0],c=!1,u=0,m=new hW;for(;++a<e.length;){let p=e[a],f=p[1];"enter"===p[0]?"tableHead"===f.type?(c=!1,0!==u&&(hJ(m,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,i=void 0,l=[0,0,0,0],d=[0,a+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(s=!1,0===d[2]&&(0!==l[1]&&(d[0]=d[1],i=hK(m,t,l,o,void 0,i),l=[0,0,0,0]),d[2]=a)):"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(d[0]=d[1],i=hK(m,t,l,o,void 0,i)),d=[(l=d)[1],a,0,0])):"tableHead"===f.type?(c=!0,u=a):"tableRow"===f.type||"tableDelimiterRow"===f.type?(u=a,0!==l[1]?(d[0]=d[1],i=hK(m,t,l,o,a,i)):0!==d[1]&&(i=hK(m,t,d,o,a,i)),o=0):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(d[3]=a)}for(0!==u&&hJ(m,t,u,n,r),m.consume(t.events),a=-1;++a<t.events.length;){let e=t.events[a];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,a))}return e}function hK(e,t,n,r,i,a){0!==n[0]&&(a.end=Object.assign({},hY(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));let s=hY(t.events,n[1]);if(a={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",a,t]]),0!==n[2]){let i=hY(t.events,n[2]),a=hY(t.events,n[3]),s={type:"tableContent",start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[["enter",s,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==i&&(a.end=Object.assign({},hY(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function hJ(e,t,n,r,i){let a=[],s=hY(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function hY(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let hX={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return mH(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return mW(r)?t(r):mG(r)?e.check({tokenize:hQ},t,n)(r):n(r)}}};function hQ(e,t,n){return mX(e,function(e){return null===e?n(e):t(e)},"whitespace")}let h0={};function h1(e){let t,n,r,i=e||h0,a=this.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),l=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(mD([{text:hT},{document:{91:{name:"gfmFootnoteDefinition",tokenize:hB,continuation:{tokenize:hV},exit:hq}},text:{91:{name:"gfmFootnoteCall",tokenize:hF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hU,resolveTo:hZ}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,a=this.events,s=0;return function(o){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(o):(e.enter("strikethroughSequenceTemporary"),function a(o){let l=pa(i);if(126===o)return s>1?r(o):(e.consume(o),s++,a);if(s<2&&!t)return r(o);let d=e.exit("strikethroughSequenceTemporary"),c=pa(o);return d._open=!c||2===c&&!!l,d._close=!l||2===l&&!!c,n(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",a,t]],o=t.parser.constructs.insideSpan.null;o&&mO(s,s.length,0,ps(o,e.slice(r+1,n),t)),mO(s,s.length,0,[["exit",a,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),mO(e,r-1,n-r+3,s),n=r+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:hH,resolveAll:hG}}},{text:{91:hX}}])),o.push([{transforms:[f1],enter:{literalAutolink:fK,literalAutolinkEmail:fJ,literalAutolinkHttp:fJ,literalAutolinkWww:fJ},exit:{literalAutolink:f0,literalAutolinkEmail:fQ,literalAutolinkHttp:fY,literalAutolinkWww:fX}},{enter:{gfmFootnoteCallString:f6,gfmFootnoteCall:f3,gfmFootnoteDefinitionLabelString:f9,gfmFootnoteDefinition:f8},exit:{gfmFootnoteCallString:f7,gfmFootnoteCall:he,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:hn}},{canContainEols:["delete"],enter:{strikethrough:ho},exit:{strikethrough:hl}},{enter:{table:hf,tableData:hv,tableHeader:hv,tableRow:hg},exit:{codeText:hy,table:hh,tableData:hx,tableHeader:hx,tableRow:hx}},{exit:{taskListCheckValueChecked:hk,taskListCheckValueUnchecked:hk,paragraph:hj}}]),l.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fH,notInConstruct:fG},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fH,notInConstruct:fG},{character:":",before:"[ps]",after:"\\/",inConstruct:fH,notInConstruct:fG}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let a=n.createTracker(i),s=a.move("[^"),o=n.enter("footnoteDefinition"),l=n.enter("label");return s+=a.move(n.safe(n.associationId(e),{before:s,after:"]"})),l(),s+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),s+=a.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,a.current()),r?ha:hi))),o(),s},footnoteReference:hr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hs}],handlers:{delete:hd}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=hm(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){let r=e.children,i=-1,a=[],s=t.enter("table");for(;++i<r.length;)a[i]=l(r[i],t,n);return s(),a}(e,n,r),e.align)},tableCell:s,tableRow:function(e,t,n,r){let i=o([l(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function s(e,t,n,r){let i=n.enter("tableCell"),s=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:a,after:a});return s(),i(),o}function o(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hc,a=[],s=[],o=[],l=[],d=0,c=-1;for(;++c<e.length;){let t=[],r=[],a=-1;for(e[c].length>d&&(d=e[c].length);++a<e[c].length;){var u;let s=null==(u=e[c][a])?"":String(u);if(!1!==n.alignDelimiters){let e=i(s);r[a]=e,(void 0===l[a]||e>l[a])&&(l[a]=e)}t.push(s)}s[c]=t,o[c]=r}let m=-1;if("object"==typeof r&&"length"in r)for(;++m<d;)a[m]=hu(r[m]);else{let e=hu(r);for(;++m<d;)a[m]=e}m=-1;let p=[],f=[];for(;++m<d;){let e=a[m],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,l[m]-t.length-r.length),s=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>l[m]&&(l[m]=i),f[m]=i),p[m]=s}s.splice(1,0,p),o.splice(1,0,f),c=-1;let h=[];for(;++c<s.length;){let e=s[c],t=o[c];m=-1;let r=[];for(;++m<d;){let i=e[m]||"",s="",o="";if(!1!==n.alignDelimiters){let e=l[m]-(t[m]||0),n=a[m];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=s=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||m||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||m)&&r.push(" "),!1!==n.alignDelimiters&&r.push(s),r.push(i),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||m!==d-1)&&r.push("|")}h.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return h.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function l(e,t,n){let r=e.children,i=-1,a=[],o=t.enter("tableRow");for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hw}}]})}function h2({className:e,children:t}){let[n,r]=(0,eP.useState)(!1),i=/language-(\w+)/.exec(e??"")?.[1],a=String(t).replace(/\n$/,"");return(0,eT.jsxs)("div",{className:"group relative my-3 overflow-hidden rounded-sm border border-border bg-background/70",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-card/60 px-3 py-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:i??"code"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(a).then(()=>{r(!0),window.setTimeout(()=>r(!1),1400)})},className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[n?(0,eT.jsx)(iq,{className:"size-3"}):(0,eT.jsx)(oC,{className:"size-3"}),n?"copied":"copy"]})]}),(0,eT.jsx)("pre",{className:"overflow-x-auto px-3 py-2.5 font-mono text-xs leading-relaxed text-foreground/90",children:(0,eT.jsx)("code",{children:a})})]})}let h4=(0,eP.memo)(function({children:e}){return(0,eT.jsx)("div",{className:"text-sm leading-relaxed text-foreground",children:(0,eT.jsx)(fV,{remarkPlugins:[h1],components:{p:({children:e})=>(0,eT.jsx)("p",{className:"mb-3 last:mb-0 text-pretty",children:e}),h1:({children:e})=>(0,eT.jsx)("h1",{className:"mb-2 mt-4 text-base font-semibold first:mt-0",children:e}),h2:({children:e})=>(0,eT.jsx)("h2",{className:"mb-2 mt-4 text-sm font-semibold first:mt-0",children:e}),h3:({children:e})=>(0,eT.jsx)("h3",{className:"mb-1.5 mt-3 text-sm font-semibold first:mt-0",children:e}),ul:({children:e})=>(0,eT.jsx)("ul",{className:"mb-3 ml-4 list-disc space-y-1 last:mb-0",children:e}),ol:({children:e})=>(0,eT.jsx)("ol",{className:"mb-3 ml-4 list-decimal space-y-1 last:mb-0",children:e}),li:({children:e})=>(0,eT.jsx)("li",{className:"text-pretty",children:e}),a:({href:e,children:t})=>(0,eT.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-foreground underline decoration-border underline-offset-2 transition-colors hover:decoration-foreground",children:t}),strong:({children:e})=>(0,eT.jsx)("strong",{className:"font-semibold text-foreground",children:e}),blockquote:({children:e})=>(0,eT.jsx)("blockquote",{className:"my-3 border-l-2 border-border pl-3 text-muted-foreground",children:e}),hr:()=>(0,eT.jsx)("hr",{className:"my-4 border-border"}),table:({children:e})=>(0,eT.jsx)("div",{className:"my-3 overflow-x-auto rounded-sm border border-border",children:(0,eT.jsx)("table",{className:"w-full border-collapse text-xs",children:e})}),th:({children:e})=>(0,eT.jsx)("th",{className:"border-b border-border bg-card px-2.5 py-1.5 text-left font-mono text-[11px] font-semibold",children:e}),td:({children:e})=>(0,eT.jsx)("td",{className:"border-b border-border px-2.5 py-1.5",children:e}),code:({className:e,children:t,...n})=>e?(0,eT.jsx)(h2,{className:e,children:t}):(0,eT.jsx)("code",{className:(0,ny.cn)("rounded-sm border border-border bg-background/70 px-1 py-0.5 font-mono text-[0.85em] text-foreground"),...n,children:t}),pre:({children:e})=>(0,eT.jsx)(eT.Fragment,{children:e})},children:e})})}),h5=e=>fetch(e).then(e=>e.json()),h6=[{id:"dashboard",label:"Dashboard",icon:cD},{id:"notes",label:"Release notes",icon:eZ},{id:"contributors",label:"Contributors",icon:uI},{id:"reactions",label:"Reactions",icon:uE},{id:"cadence",label:"Cadence",icon:u$},{id:"compare",label:"Compare",icon:uS}],h3=[{key:"plusOne",emoji:"👍",label:"+1"},{key:"minusOne",emoji:"👎",label:"-1"},{key:"laugh",emoji:"😄",label:"Laugh"},{key:"hooray",emoji:"🎉",label:"Hooray"},{key:"heart",emoji:"❤️",label:"Heart"},{key:"rocket",emoji:"🚀",label:"Rocket"},{key:"eyes",emoji:"👀",label:"Eyes"},{key:"confused",emoji:"😕",label:"Confused"}];function h9(e){return e.toLocaleString()}function h8(e){return e?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"—"}function h7(e,t){return Math.abs(new Date(e).getTime()-new Date(t).getTime())/864e5}function ge({icon:e,label:t,value:n,sub:r}){return(0,eT.jsxs)(s8,{className:"flex flex-row items-center gap-3 p-4",children:[(0,eT.jsx)("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-sm border border-border text-muted-foreground",children:(0,eT.jsx)(e,{className:"size-5"})}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),(0,eT.jsx)("p",{className:"truncate text-lg font-semibold tabular-nums text-foreground",children:n}),r&&(0,eT.jsx)("p",{className:"truncate font-mono text-[10px] text-muted-foreground",children:r})]})]})}function gt({release:e}){return(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.prerelease&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-medium)]/15 font-mono text-[10px] text-[color:var(--sev-medium)]",children:"pre-release"}),e.draft&&(0,eT.jsx)(nS,{className:"border-0 bg-secondary font-mono text-[10px] text-muted-foreground",children:"draft"})]})}function gn({releases:e}){let t=(0,eP.useMemo)(()=>{let t=e.filter(e=>e.publishedAt),n=e.reduce((e,t)=>e+t.totalDownloads,0),r=e.reduce((e,t)=>e+(t.reactions?.total??0),0),i=t.map(e=>e.publishedAt).sort((e,t)=>new Date(t).getTime()-new Date(e).getTime()),a=[];for(let e=0;e<i.length-1;e++)a.push(h7(i[e],i[e+1]));return{total:e.length,prereleases:e.filter(e=>e.prerelease).length,totalDownloads:n,totalReactions:r,latest:t[0]??e[0],medianGap:Math.round(function(e){if(0===e.length)return 0;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2}(a))}},[e]),n=(0,eP.useMemo)(()=>[...e].sort((e,t)=>t.totalDownloads-e.totalDownloads).slice(0,5),[e]);return(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,eT.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,eT.jsx)(ge,{icon:cM,label:"Releases",value:h9(t.total),sub:`${t.prereleases} pre-release`}),(0,eT.jsx)(ge,{icon:st,label:"Downloads",value:h9(t.totalDownloads),sub:"across all assets"}),(0,eT.jsx)(ge,{icon:uE,label:"Reactions",value:h9(t.totalReactions),sub:"community feedback"}),(0,eT.jsx)(ge,{icon:u$,label:"Median cadence",value:t.medianGap?`${t.medianGap}d`:"—",sub:"between releases"})]}),t.latest&&(0,eT.jsx)(oS,{title:"Latest release",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cD,{className:"size-4 text-[color:var(--sev-ok)]"}),(0,eT.jsx)("span",{className:"font-semibold text-foreground",children:t.latest.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:t.latest.tag}),(0,eT.jsx)(gt,{release:t.latest})]}),(0,eT.jsxs)("a",{href:t.latest.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"})," GitHub"]})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:h8(t.latest.publishedAt)}),t.latest.author&&(0,eT.jsxs)("span",{children:["by ",t.latest.author.login]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(st,{className:"size-3"})," ",h9(t.latest.totalDownloads)]})]})]})}),(0,eT.jsx)(oS,{title:"Most downloaded",children:n.every(e=>0===e.totalDownloads)?(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"No downloadable assets attached to releases."}):(0,eT.jsx)("div",{className:"flex flex-col gap-2.5",children:n.map(e=>{let t=n[0].totalDownloads||1,r=e.totalDownloads/t*100;return(0,eT.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:h9(e.totalDownloads)})]}),(0,eT.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${Math.max(r,2)}%`}})})]},e.id)})})})]})}function gr({releases:e}){let[t,n]=(0,eP.useState)(e[0]?.id??null),r=e.find(e=>e.id===t)??e[0];return r?(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[220px_1fr]",children:[(0,eT.jsx)("div",{className:"flex max-h-[60vh] flex-col gap-1 overflow-auto rounded-sm border border-border bg-card p-2",children:e.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.id),className:(0,ny.cn)("flex flex-col gap-0.5 rounded-sm px-2.5 py-2 text-left transition-colors",e.id===r.id?"bg-secondary":"hover:bg-secondary/50"),children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs font-medium text-foreground",children:e.tag}),(0,eT.jsx)("span",{className:"truncate text-[10px] text-muted-foreground",children:h8(e.publishedAt)})]},e.id))}),(0,eT.jsxs)(s8,{className:"min-w-0 p-5",children:[(0,eT.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2 border-b border-border pb-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("h3",{className:"text-base font-semibold text-foreground",children:r.name}),(0,eT.jsx)(gt,{release:r})]}),(0,eT.jsxs)("a",{href:r.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"})," View on GitHub"]})]}),r.assets.length>0&&(0,eT.jsx)("div",{className:"mb-4 flex flex-col gap-1.5",children:r.assets.map(e=>{var t;return(0,eT.jsxs)("div",{className:"flex items-center gap-2 rounded-sm border border-border px-2.5 py-1.5 font-mono text-[11px]",children:[(0,eT.jsx)(eq,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"shrink-0 text-muted-foreground",children:(t=e.size)<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:t<0x40000000?`${(t/1048576).toFixed(1)} MB`:`${(t/0x40000000).toFixed(2)} GB`}),(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(st,{className:"size-3"}),h9(e.downloadCount)]})]},e.name)})}),r.body.trim()?(0,eT.jsx)(h4,{children:r.body}):(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No release notes provided."})]})]}):null}function gi({releases:e}){let t=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e){if(!n.author)continue;let e=t.get(n.author.login)??{login:n.author.login,avatarUrl:n.author.avatarUrl,htmlUrl:n.author.htmlUrl,releases:0,downloads:0};e.releases+=1,e.downloads+=n.totalDownloads,t.set(n.author.login,e)}return[...t.values()].sort((e,t)=>t.releases-e.releases)},[e]);if(0===t.length)return(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No release authors found."});let n=t[0].releases;return(0,eT.jsx)("div",{className:"flex flex-col gap-2.5",children:t.map((e,t)=>(0,eT.jsxs)(s8,{className:"flex flex-row items-center gap-3 p-3",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-7 shrink-0 items-center justify-center rounded-full font-mono text-xs font-semibold",0===t?"bg-[color:var(--sev-medium)]/20 text-[color:var(--sev-medium)]":"bg-secondary text-muted-foreground"),children:t+1}),(0,eT.jsx)("img",{src:e.avatarUrl||"/placeholder.svg",alt:"",className:"size-9 shrink-0 rounded-full"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"truncate font-medium text-foreground hover:underline",children:e.login}),(0,eT.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${e.releases/n*100}%`}})})]}),(0,eT.jsxs)("div",{className:"shrink-0 text-right font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("p",{className:"text-foreground",children:[e.releases," releases"]}),(0,eT.jsxs)("p",{children:[h9(e.downloads)," downloads"]})]})]},e.login))})}function ga({releases:e}){let{totals:t,ranked:n}=(0,eP.useMemo)(()=>{let t={total:0,plusOne:0,minusOne:0,laugh:0,hooray:0,confused:0,heart:0,rocket:0,eyes:0};for(let n of e)if(n.reactions)for(let e of Object.keys(t))t[e]+=n.reactions[e];return{totals:t,ranked:e.filter(e=>(e.reactions?.total??0)>0).sort((e,t)=>(t.reactions?.total??0)-(e.reactions?.total??0)).slice(0,8)}},[e]);if(0===t.total)return(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(uE,{className:"size-5 text-muted-foreground"}),"No reactions on releases yet."]});let r=Math.max(...h3.map(e=>t[e.key]));return(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,eT.jsx)(oS,{title:`Community reactions (${h9(t.total)})`,children:(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:h3.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("span",{className:"w-6 text-center text-base","aria-hidden":!0,children:e.emoji}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,eT.jsx)("span",{className:"tabular-nums text-foreground",children:h9(t[e.key])})]}),(0,eT.jsx)("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${r?t[e.key]/r*100:0}%`}})})]})]},e.key))})}),n.length>0&&(0,eT.jsx)(oS,{title:"Most-loved releases",children:(0,eT.jsx)("div",{className:"flex flex-col divide-y divide-border",children:n.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-3 py-2.5 first:pt-0 last:pb-0",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.tag}),(0,eT.jsx)("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:h3.filter(t=>(e.reactions?.[t.key]??0)>0).map(t=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,eT.jsx)("span",{"aria-hidden":!0,children:t.emoji}),e.reactions?.[t.key]]},t.key))})]},e.id))})})]})}function gs({releases:e}){let{years:t,months:n,grid:r,max:i}=(0,eP.useMemo)(()=>{let t=new Map,n=1/0,r=-1/0;for(let i of e){if(!i.publishedAt)continue;let e=new Date(i.publishedAt),a=e.getFullYear(),s=e.getMonth();t.set(`${a}-${s}`,(t.get(`${a}-${s}`)??0)+1),n=Math.min(n,a),r=Math.max(r,a)}let i=[];if(Number.isFinite(n))for(let e=r;e>=n;e--)i.push(e);let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],s=Math.max(1,...t.values()),o=i.map(e=>({year:e,cells:a.map((n,r)=>t.get(`${e}-${r}`)??0)}));return{years:i,months:a,grid:o,max:s}},[e]);return 0===t.length?(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No published releases to chart."}):(0,eT.jsx)(oS,{title:"Release cadence",children:(0,eT.jsx)("div",{className:"overflow-x-auto",children:(0,eT.jsxs)("div",{className:"min-w-[520px]",children:[(0,eT.jsxs)("div",{className:"mb-1 grid grid-cols-[40px_repeat(12,1fr)] gap-1",children:[(0,eT.jsx)("span",{}),n.map(e=>(0,eT.jsx)("span",{className:"text-center font-mono text-[10px] text-muted-foreground",children:e},e))]}),r.map(e=>(0,eT.jsxs)("div",{className:"mb-1 grid grid-cols-[40px_repeat(12,1fr)] items-center gap-1",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.year}),e.cells.map((t,r)=>(0,eT.jsx)("div",{title:`${n[r]} ${e.year}: ${t} release${1===t?"":"s"}`,className:(0,ny.cn)("aspect-square rounded-sm",function(e){if(0===e)return"bg-secondary";let t=e/i;return t>.66?"bg-primary":t>.33?"bg-primary/60":"bg-primary/30"}(t))},r))]},e.year)),(0,eT.jsxs)("div",{className:"mt-3 flex items-center justify-end gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:"less"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-secondary"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary/30"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary/60"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary"}),(0,eT.jsx)("span",{children:"more"})]})]})})})}function go({releases:e}){let[t,n]=(0,eP.useState)(e[1]?.id??e[0]?.id??null),[r,i]=(0,eP.useState)(e[0]?.id??null),a=e.find(e=>e.id===t),s=e.find(e=>e.id===r);function o({value:t,onChange:n}){return(0,eT.jsx)("select",{value:t??"",onChange:e=>n(Number(e.target.value)),className:"w-full rounded-sm border border-border bg-background px-2 py-1.5 font-mono text-xs text-foreground outline-none focus:border-foreground/30",children:e.map(e=>(0,eT.jsxs)("option",{value:e.id,children:[e.tag," — ",h8(e.publishedAt)]},e.id))})}function l({release:e}){return e?(0,eT.jsxs)(s8,{className:"flex min-w-0 flex-col gap-3 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border pb-2",children:[(0,eT.jsx)("span",{className:"truncate font-semibold text-foreground",children:e.name}),(0,eT.jsx)(gt,{release:e})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-2 font-mono text-[11px]",children:[(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Published"}),(0,eT.jsx)("dd",{className:"text-right text-foreground",children:h8(e.publishedAt)}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Author"}),(0,eT.jsx)("dd",{className:"truncate text-right text-foreground",children:e.author?.login??"—"}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Downloads"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:h9(e.totalDownloads)}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Assets"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:e.assets.length}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Reactions"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:h9(e.reactions?.total??0)})]}),(0,eT.jsx)("div",{className:"max-h-72 overflow-auto border-t border-border pt-3",children:e.body.trim()?(0,eT.jsx)(h4,{children:e.body}):(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"No notes."})})]}):(0,eT.jsx)(s8,{className:"p-5 text-sm text-muted-foreground",children:"Select a release."})}let d=(0,eP.useMemo)(()=>a&&s?{days:Math.round(h7(a.publishedAt??a.createdAt,s.publishedAt??s.createdAt)),downloads:s.totalDownloads-a.totalDownloads,reactions:(s.reactions?.total??0)-(a.reactions?.total??0)}:null,[a,s]);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid items-center gap-3 sm:grid-cols-[1fr_auto_1fr]",children:[(0,eT.jsx)(o,{value:t,onChange:n}),(0,eT.jsx)(uC,{className:"mx-auto size-4 rotate-90 text-muted-foreground sm:rotate-0"}),(0,eT.jsx)(o,{value:r,onChange:i})]}),d&&(0,eT.jsxs)(s8,{className:"grid grid-cols-3 divide-x divide-border p-0",children:[(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Time apart"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.days,"d"]})]}),(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Δ downloads"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.downloads>0?"+":"",h9(d.downloads)]})]}),(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Δ reactions"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.reactions>0?"+":"",h9(d.reactions)]})]})]}),(0,eT.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,eT.jsx)(l,{release:a}),(0,eT.jsx)(l,{release:s})]})]})}function gl({owner:e,repo:t}){let[n,r]=(0,eP.useState)("dashboard"),[i,a]=(0,eP.useState)(""),[s,o]=(0,eP.useState)("all"),{data:l,isLoading:d,error:c}=u_(e&&t?`/api/github/releases?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`:null,h5,{revalidateOnFocus:!1}),u=(0,eP.useMemo)(()=>l?.releases??[],[l]),m=(0,eP.useMemo)(()=>{let e=i.trim().toLowerCase();return u.filter(t=>("stable"!==s||!t.prerelease)&&("prerelease"!==s||!!t.prerelease)&&(!e||t.name.toLowerCase().includes(e)||t.tag.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||(t.author?.login.toLowerCase().includes(e)??!1)))},[u,i,s]);return d?(0,eT.jsxs)("div",{className:"flex items-center justify-center gap-2 py-16 font-mono text-sm text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"}),"Loading releases from GitHub…"]}):c||l?.error?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-5 text-[color:var(--sev-medium)]"}),l?.error??"Could not load releases from GitHub."]}):0===u.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(cM,{className:"size-5 text-muted-foreground"}),"This repository has no published releases."]}):(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:h6.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.id),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors",n===e.id?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-3.5"}),e.label]},e.id))}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:i,onChange:e=>a(e.target.value),placeholder:"Search tag, title, notes, author…",className:"w-full rounded-sm border border-border bg-background py-2 pl-9 pr-8 font-mono text-xs text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),i&&(0,eT.jsx)("button",{type:"button",onClick:()=>a(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(0,eT.jsx)("div",{className:"flex items-center gap-1.5",children:["all","stable","prerelease"].map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>o(e),className:(0,ny.cn)("rounded-sm border px-2.5 py-1.5 font-mono text-[11px] capitalize transition-colors",s===e?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:e},e))})]}),(0,eT.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[m.length," of ",u.length," releases"]}),0===m.length?(0,eT.jsx)(s8,{className:"p-6 text-center text-sm text-muted-foreground",children:"No releases match your search."}):(0,eT.jsxs)(eT.Fragment,{children:["dashboard"===n&&(0,eT.jsx)(gn,{releases:m}),"notes"===n&&(0,eT.jsx)(gr,{releases:m}),"contributors"===n&&(0,eT.jsx)(gi,{releases:m}),"reactions"===n&&(0,eT.jsx)(ga,{releases:m}),"cadence"===n&&(0,eT.jsx)(gs,{releases:m}),"compare"===n&&(0,eT.jsx)(go,{releases:m})]})]})}let gd=eL("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),gc=eL("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),gu=eL("scale",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]);function gm(e){return(0,eT.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",...e,children:(0,eT.jsx)("path",{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 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}let gp=e=>fetch(e).then(e=>e.json()),gf=["var(--primary)","var(--sev-ok)","var(--sev-medium)","var(--sev-info)","var(--sev-high)","var(--muted-foreground)"];function gh(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function gg({source:e,detected:t,onChange:n}){let[r,i]=(0,eP.useState)(!1),[a,s]=(0,eP.useState)(e?.owner??""),[o,l]=(0,eP.useState)(e?.repo??"");function d(){let e=a.trim(),t=o.trim().replace(/\.git$/,"");e&&t&&(n({owner:e,repo:t}),i(!1))}return r||!e?(0,eT.jsxs)(s8,{className:"flex flex-col gap-2 p-3 sm:flex-row sm:items-center",children:[(0,eT.jsx)(gm,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"flex flex-1 items-center gap-1.5 font-mono text-xs",children:[(0,eT.jsx)("input",{value:a,onChange:e=>s(e.target.value),placeholder:"owner",className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-2 py-1.5 text-foreground outline-none focus:border-foreground/30"}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:"/"}),(0,eT.jsx)("input",{value:o,onChange:e=>l(e.target.value),placeholder:"repo",onKeyDown:e=>"Enter"===e.key&&d(),className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-2 py-1.5 text-foreground outline-none focus:border-foreground/30"})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eT.jsxs)("button",{type:"button",onClick:d,className:"inline-flex items-center gap-1 rounded-sm bg-primary px-2.5 py-1.5 font-mono text-xs text-primary-foreground hover:bg-primary/90",children:[(0,eT.jsx)(iq,{className:"size-3.5"})," Load"]}),e&&(0,eT.jsx)("button",{type:"button",onClick:()=>i(!1),"aria-label":"Cancel",className:"inline-flex items-center rounded-sm border border-border px-2 py-1.5 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})}),t&&(t.owner!==a||t.repo!==o)&&(0,eT.jsx)("button",{type:"button",onClick:()=>{s(t.owner),l(t.repo),n(t),i(!1)},className:"font-mono text-[11px] text-muted-foreground underline hover:text-foreground",children:"reset to detected"})]})]}):(0,eT.jsxs)(s8,{className:"flex items-center justify-between gap-2 p-3",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,eT.jsx)(gm,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"truncate font-mono text-sm text-foreground",children:[e.owner,"/",e.repo]}),t&&t.owner===e.owner&&t.repo===e.repo&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"detected"})]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>i(!0),className:"inline-flex shrink-0 items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(l5,{className:"size-3"})," Change"]})]})}function gx({icon:e,label:t,value:n}){return(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums text-foreground",children:n}),(0,eT.jsx)("span",{className:"ml-1 font-mono text-[10px] text-muted-foreground",children:t})]})]})}function gv({source:e}){let{data:t,isLoading:n,error:r}=u_(`/api/github/repo?owner=${encodeURIComponent(e.owner)}&repo=${encodeURIComponent(e.repo)}`,gp,{revalidateOnFocus:!1});if(n)return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex items-center gap-2 py-3 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"})," Loading repository…"]})});if(r||t?.error||!t?.overview)return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2 py-1 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-3.5 shrink-0 text-[color:var(--sev-medium)]"}),t?.error??"Could not reach the GitHub API."]})});let i=t.overview,a=i.languages.reduce((e,t)=>e+t.bytes,0)||1;return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[i.description&&(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-foreground",children:i.description}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-2.5",children:[(0,eT.jsx)(gx,{icon:gd,label:"stars",value:gh(i.stars)}),(0,eT.jsx)(gx,{icon:cO,label:"forks",value:gh(i.forks)}),(0,eT.jsx)(gx,{icon:cv,label:"watchers",value:gh(i.subscribers)}),(0,eT.jsx)(gx,{icon:gc,label:"open issues",value:gh(i.openIssues)})]}),i.license&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-t border-border pt-3",children:[(0,eT.jsx)(gu,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:i.license})]}),i.languages.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border pt-3",children:[(0,eT.jsx)("div",{className:"flex h-2 overflow-hidden rounded-full",children:i.languages.slice(0,6).map((e,t)=>(0,eT.jsx)("div",{title:`${e.name} ${(e.bytes/a*100).toFixed(1)}%`,style:{width:`${e.bytes/a*100}%`,background:gf[t%gf.length]}},e.name))}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:i.languages.slice(0,4).map((e,t)=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"size-2 rounded-full",style:{background:gf[t%gf.length]},"aria-hidden":!0}),e.name]},e.name))})]}),i.contributors.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Top contributors"}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.contributors.slice(0,8).map(e=>(0,eT.jsx)("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",title:`${e.login} \xb7 ${e.contributions} commits`,children:(0,eT.jsx)("img",{src:e.avatarUrl||"/placeholder.svg",alt:e.login,className:"size-7 rounded-full ring-1 ring-border transition-transform hover:scale-110"})},e.login))})]}),(0,eT.jsxs)("a",{href:i.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:(0,ny.cn)("inline-flex items-center justify-center gap-1.5 rounded-sm border border-border px-2 py-1.5","font-mono text-[11px] text-foreground transition-colors hover:bg-secondary"),children:[(0,eT.jsx)(oE,{className:"size-3"}),"Open on GitHub"]})]})})}let gy=[{id:"vercel",name:"Vercel AI Gateway",blurb:"Zero-config routing to OpenAI, Anthropic, Google and more. Recommended default.",envVar:"AI_GATEWAY_API_KEY",keyPrefix:"vck_",needsKey:!0,keyUrl:"https://vercel.com/docs/ai-gateway",models:[{id:"anthropic/claude-opus-4.6",label:"Claude Opus 4.6",note:"Deepest reasoning · best for security"},{id:"anthropic/claude-sonnet-4.5",label:"Claude Sonnet 4.5",note:"Balanced quality / speed"},{id:"openai/gpt-5",label:"GPT-5",note:"Strong general analysis"},{id:"openai/gpt-5-mini",label:"GPT-5 Mini",note:"Fast triage pass"},{id:"google/gemini-3-flash",label:"Gemini 3 Flash",note:"Very fast, large context"}]},{id:"openrouter",name:"OpenRouter",blurb:"Single key, hundreds of models across providers — including free tiers.",envVar:"OPENROUTER_API_KEY",keyPrefix:"sk-or-",needsKey:!0,keyUrl:"https://openrouter.ai/keys",models:[{id:"meta-llama/llama-3.3-70b-instruct:free",label:"Llama 3.3 70B (free)",note:"Free · solid general text model"},{id:"deepseek/deepseek-chat-v3-0324:free",label:"DeepSeek V3 (free)",note:"Free · strong reasoning"},{id:"google/gemini-2.0-flash-exp:free",label:"Gemini 2.0 Flash (free)",note:"Free · fast, large context"},{id:"anthropic/claude-opus-4.6",label:"Claude Opus 4.6"},{id:"anthropic/claude-3.7-sonnet",label:"Claude 3.7 Sonnet"},{id:"openai/gpt-5",label:"GPT-5"},{id:"google/gemini-2.5-pro",label:"Gemini 2.5 Pro"},{id:"deepseek/deepseek-r1",label:"DeepSeek R1",note:"Open weights"},{id:"meta-llama/llama-3.3-70b-instruct",label:"Llama 3.3 70B"}]},{id:"anthropic",name:"Anthropic",blurb:"Claude models directly from Anthropic.",envVar:"ANTHROPIC_API_KEY",keyPrefix:"sk-ant-",needsKey:!0,keyUrl:"https://console.anthropic.com/settings/keys",models:[{id:"claude-opus-4-6",label:"Claude Opus 4.6",note:"Best for security review"},{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5"},{id:"claude-haiku-4",label:"Claude Haiku 4",note:"Fast triage"}]},{id:"openai",name:"OpenAI",blurb:"GPT models directly from OpenAI.",envVar:"OPENAI_API_KEY",keyPrefix:"sk-",needsKey:!0,keyUrl:"https://platform.openai.com/api-keys",models:[{id:"gpt-5",label:"GPT-5"},{id:"gpt-5-mini",label:"GPT-5 Mini",note:"Fast triage"},{id:"o4-mini",label:"o4-mini",note:"Reasoning, low cost"}]},{id:"xai",name:"xAI (Grok)",blurb:"Grok models from xAI. Requires an AI Gateway key with xAI enabled.",envVar:"XAI_API_KEY",keyPrefix:"xai-",needsKey:!0,keyUrl:"https://x.ai/api",models:[{id:"grok-4",label:"Grok 4"},{id:"grok-4-fast",label:"Grok 4 Fast",note:"Fast triage"}]},{id:"ollama",name:"Ollama (local)",blurb:"Run models fully offline on your machine. No code leaves your computer.",envVar:"OLLAMA_HOST",needsKey:!1,keyUrl:"https://ollama.com",models:[{id:"qwen2.5-coder:14b",label:"Qwen2.5 Coder 14B",note:"Best local code model"},{id:"llama3.1:8b",label:"Llama 3.1 8B",note:"Lightweight"},{id:"deepseek-r1:14b",label:"DeepSeek R1 14B",note:"Reasoning"}]}];function gb(e){return gy.find(t=>t.id===e)??gy[0]}let gk={provider:"openrouter",model:"meta-llama/llama-3.3-70b-instruct:free",keys:{},aiEnabled:!0,redactSecrets:!0,maxFiles:25,chatEnabled:!0,persistChats:!0,githubToken:"",defaultRepo:"",colorAccents:!1},gj="projectlens.settings.v1";function gw(e){"u">typeof document&&document.documentElement.classList.toggle("accents",e)}function gN(){try{let e=window.localStorage.getItem(gj);if(!e)return gk;let t=JSON.parse(e);return{...gk,...t,keys:{...gk.keys,...t.keys}}}catch{return gk}}function g_(e){window.localStorage.setItem(gj,JSON.stringify(e))}let gS={modified:"M",added:"A",deleted:"D",untracked:"??",renamed:"R"},g$={modified:"var(--sev-medium)",added:"var(--sev-ok)",deleted:"var(--sev-critical)",untracked:"var(--sev-medium)",renamed:"var(--sev-info)"};function gI(e){switch(e){case"passing":return{Icon:da,color:"var(--sev-ok)",label:"Passing"};case"failing":return{Icon:i5,color:"var(--sev-critical)",label:"Failing"};case"disabled":return{Icon:d9,color:"var(--sev-info)",label:"Disabled"};default:return{Icon:d9,color:"var(--sev-info)",label:"No runs"}}}function gE({value:e,label:t="Copy"}){let[n,r]=(0,eP.useState)(!1);return(0,eT.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),window.setTimeout(()=>r(!1),1400)})},className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(oC,{className:"size-3.5"}),n?"Copied":t]})}function gC({label:e,children:t}){return(0,eT.jsxs)("div",{className:"flex items-baseline gap-3 px-3 py-2",children:[(0,eT.jsx)("span",{className:"w-24 shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 text-sm text-foreground",children:t})]})}function gA({detail:e,remoteInfo:t,onClose:n}){let r=t?.provider==="GitHub"?t.url:null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&n(),children:(0,eT.jsxs)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-xl",children:[e?.kind==="commit"&&(0,eT.jsx)(gT,{commit:e.commit,ghBase:r}),e?.kind==="branch"&&(0,eT.jsx)(gP,{branch:e.branch,ghBase:r}),e?.kind==="tag"&&(0,eT.jsx)(gz,{tag:e.tag,ghBase:r})]})})}function gT({commit:e,ghBase:t}){let n=e.fullHash||e.hash,[r,...i]=e.message.split("\n"),a=e.body||i.join("\n").trim();return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(cE,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate text-sm",children:r})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Commit detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:e.hash}),(0,eT.jsx)(gE,{value:n,label:"Copy SHA"}),t&&(0,eT.jsxs)("a",{href:`${t}/commit/${n}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View on GitHub"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[a&&(0,eT.jsx)("p",{className:"whitespace-pre-wrap text-pretty text-sm leading-relaxed text-muted-foreground",children:a}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[(0,eT.jsxs)(gC,{label:"Author",children:[e.author,e.email&&(0,eT.jsxs)("span",{className:"ml-1.5 font-mono text-xs text-muted-foreground",children:["<",e.email,">"]})]}),(0,eT.jsxs)(gC,{label:"Date",children:[(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.relative}),e.date&&(0,eT.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:new Date(e.date).toLocaleString()})]}),(0,eT.jsx)(gC,{label:"Commit",children:(0,eT.jsx)("span",{className:"break-all font-mono text-xs",children:n})}),(null!=e.insertions||null!=e.deletions)&&(0,eT.jsx)(gC,{label:"Changes",children:(0,eT.jsxs)("span",{className:"font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"text-[color:var(--sev-ok)]",children:["+",e.insertions??0]})," ",(0,eT.jsxs)("span",{className:"text-[color:var(--sev-critical)]",children:["-",e.deletions??0]}),e.files?` \xb7 ${e.files.length} files`:""]})}),e.refs&&e.refs.length>0&&(0,eT.jsx)(gC,{label:"Refs",children:(0,eT.jsx)("span",{className:"flex flex-wrap gap-1",children:e.refs.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},e))})})]})}),e.files&&e.files.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(cL,{className:"size-3.5"})," Files changed (",e.files.length,")"]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:e.files.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2.5 border-t border-border px-3 py-2 first:border-t-0",children:[(0,eT.jsx)("span",{className:"w-5 shrink-0 text-center font-mono text-[10px]",style:{color:g$[e.status]},children:gS[e.status]}),(0,eT.jsx)(lR,{path:e.path,className:"text-xs"})]},e.path))})]})]})]})}function gP({branch:e,ghBase:t}){return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[e.remote?(0,eT.jsx)(cO,{className:"size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eK,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:e.name})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Branch detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.current&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/15 font-mono text-[10px] text-[color:var(--sev-ok)]",children:"current"}),e.merged&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(cZ,{className:"size-3"})," merged"]}),(0,eT.jsx)(gE,{value:e.name,label:"Copy name"}),t&&!e.remote&&(0,eT.jsxs)("a",{href:`${t}/tree/${e.name}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View on GitHub"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-lg tabular-nums text-foreground",children:[(0,eT.jsx)(cC,{className:"size-3.5 text-[color:var(--sev-ok)]"})," ",e.ahead??0]}),(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"ahead of default"})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-lg tabular-nums text-foreground",children:[(0,eT.jsx)(cA,{className:"size-3.5 text-[color:var(--sev-high)]"})," ",e.behind??0]}),(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"behind default"})]})]}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[(0,eT.jsx)(gC,{label:"Type",children:e.remote?"Remote-tracking":"Local"}),e.upstream&&(0,eT.jsx)(gC,{label:"Upstream",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.upstream})}),e.tip&&(0,eT.jsx)(gC,{label:"Tip",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.tip})}),e.subject&&(0,eT.jsx)(gC,{label:"Last commit",children:e.subject}),e.author&&(0,eT.jsx)(gC,{label:"Author",children:e.author}),e.lastCommitRelative&&(0,eT.jsx)(gC,{label:"Updated",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.lastCommitRelative})})]})})]})]})}function gz({tag:e,ghBase:t}){return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(cM,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:e.name})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Tag detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.annotated?"annotated":"lightweight"}),(0,eT.jsx)(gE,{value:e.name,label:"Copy tag"}),t&&(0,eT.jsxs)("a",{href:`${t}/releases/tag/${e.name}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View release"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[e.message&&(0,eT.jsx)("p",{className:"whitespace-pre-wrap text-pretty text-sm leading-relaxed text-muted-foreground",children:e.message}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[e.commit&&(0,eT.jsx)(gC,{label:"Commit",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.commit})}),e.tagger&&(0,eT.jsx)(gC,{label:"Tagger",children:e.tagger}),e.relative&&(0,eT.jsxs)(gC,{label:"Date",children:[(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.relative}),e.date&&(0,eT.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:new Date(e.date).toLocaleDateString()})]})]})})]})]})}function gO({issue:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o1(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o1(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"mt-1.5",children:(0,eT.jsx)(lR,{path:e.filePath,className:"text-[11px]"})})]}),(0,eT.jsx)(lM,{issue:o1(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function gM({step:e}){let t=e.diagnostics&&e.diagnostics.length>0;return(0,eT.jsx)("div",{className:"flex flex-col gap-1 border-t border-border px-3 py-2 first:border-t-0",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[t?(0,eT.jsx)(i5,{className:"mt-0.5 size-3.5 shrink-0 text-[color:var(--sev-high)]"}):(0,eT.jsx)(da,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/50"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"text-xs text-foreground",children:e.name}),e.uses&&(0,eT.jsx)("span",{className:"ml-2 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.uses}),e.run&&(0,eT.jsxs)("pre",{className:"mt-1 overflow-x-auto rounded-sm bg-background/60 px-2 py-1 font-mono text-[11px] text-foreground/80",children:["$ ",e.run]}),e.condition&&(0,eT.jsxs)("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground",children:["if: ",e.condition]}),t&&e.diagnostics.map((e,t)=>(0,eT.jsxs)("p",{className:"mt-1 flex items-start gap-1 text-[11px] leading-relaxed text-[color:var(--sev-high)]",children:[(0,eT.jsx)(cU,{className:"mt-0.5 size-3 shrink-0"})," ",e]},t))]})]})})}function gR({job:e}){let[t,n]=(0,eP.useState)("failing"===e.status),r=gI(e.status);return(0,eT.jsxs)("div",{className:"overflow-hidden rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(r.Icon,{className:"size-4 shrink-0",style:{color:r.color}}),(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.name}),e.runsOn&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.runsOn}),e.needs&&e.needs.length>0&&(0,eT.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["needs: ",e.needs.join(", ")]}),(0,eT.jsxs)("span",{className:"ml-auto flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[null!=e.durationMs&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(i4,{className:"size-3"})," ",(e.durationMs/1e3).toFixed(0),"s"]}),e.steps&&(0,eT.jsxs)("span",{children:[e.steps.length," steps"]}),(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})]})]}),t&&e.condition&&(0,eT.jsxs)("p",{className:"border-t border-border bg-secondary/20 px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:["if: ",e.condition]}),t&&e.steps&&e.steps.length>0&&(0,eT.jsx)("div",{className:"border-t border-border",children:e.steps.map((e,t)=>(0,eT.jsx)(gM,{step:e},`${e.name}-${t}`))})]})}function gD({wf:e}){let t=gI(e.status);return(0,eT.jsxs)(s8,{className:"gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-3 border-b border-border bg-secondary/30 px-4 py-3",children:[(0,eT.jsx)(cT,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:e.name}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[11px]",style:{color:t.color},children:[(0,eT.jsx)(t.Icon,{className:"size-3.5"}),t.label]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.provider})]}),(0,eT.jsx)(lR,{path:e.file,className:"text-[11px]"})]}),(0,eT.jsx)("div",{className:"flex shrink-0 flex-wrap justify-end gap-1",children:e.triggers.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},e))})]}),(e.concurrency||e.permissions&&e.permissions.length>0||e.env&&e.env.length>0)&&(0,eT.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-b border-border px-4 py-2 font-mono text-[10px] text-muted-foreground",children:[e.concurrency&&(0,eT.jsxs)("span",{children:["concurrency: ",e.concurrency]}),e.permissions&&e.permissions.length>0&&(0,eT.jsxs)("span",{children:["permissions: ",e.permissions.join(", ")]}),e.env&&e.env.length>0&&(0,eT.jsxs)("span",{children:["env: ",e.env.join(", ")]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-2 p-3",children:e.jobs.map(e=>(0,eT.jsx)(gR,{job:e},e.name))}),e.diagnosis&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border bg-secondary/20 px-4 py-3",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(cU,{className:"size-3.5"}),"Diagnose & run locally"]}),e.diagnosis.localCommand&&(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsxs)("pre",{className:"flex-1 overflow-x-auto rounded-sm border border-border bg-background/60 px-2.5 py-1.5 font-mono text-[11px] text-foreground",children:[(0,eT.jsx)(e2,{className:"mr-1.5 inline size-3 text-muted-foreground"}),e.diagnosis.localCommand]}),(0,eT.jsx)(gE,{value:e.diagnosis.localCommand})]}),(0,eT.jsx)("ul",{className:"flex flex-col gap-1",children:e.diagnosis.notes.map((e,t)=>(0,eT.jsxs)("li",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-muted-foreground",children:[(0,eT.jsx)(a4,{className:"mt-0.5 size-3 shrink-0"})," ",e]},t))})]}),e.issues.length>0&&(0,eT.jsx)("div",{className:"flex flex-col border-t border-border",children:e.issues.map(e=>(0,eT.jsx)(gO,{issue:e},e.id))})]})}function gL({branch:e,onOpen:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2.5 border-t border-border px-4 py-2.5 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[e.current?(0,eT.jsx)(iq,{className:"size-3.5 shrink-0 text-[color:var(--sev-ok)]"}):e.remote?(0,eT.jsx)(cO,{className:"size-3.5 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eK,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)("min-w-0 flex-1 truncate font-mono text-xs",e.current?"font-semibold text-foreground":"text-foreground"),children:e.name}),null!=e.ahead&&e.ahead>0||null!=e.behind&&e.behind>0?(0,eT.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[null!=e.ahead&&e.ahead>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center",children:[(0,eT.jsx)(cC,{className:"size-3"}),e.ahead]}),null!=e.behind&&e.behind>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center",children:[(0,eT.jsx)(cA,{className:"size-3"}),e.behind]})]}):null,e.current&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/15 font-mono text-[10px] text-[color:var(--sev-ok)]",children:"current"}),e.remote&&!e.current&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:"remote"}),e.lastCommitRelative&&(0,eT.jsx)("span",{className:"hidden shrink-0 font-mono text-[10px] text-muted-foreground sm:inline",children:e.lastCommitRelative}),(0,eT.jsx)(a4,{className:"size-4 shrink-0 text-muted-foreground"})]})}function gU({git:e}){let{state:t}=e,[n,r]=(0,eP.useState)(!1),[i,a]=(0,eP.useState)("repository"),[s,o]=(0,eP.useState)(null),l=[...e.issues].sort(oq),d=t.branches.filter(e=>!e.remote),c=t.branches.filter(e=>e.remote),u=[...d,...c],[m,p]=(0,eP.useState)(null);(0,eP.useEffect)(()=>{let e=gN().defaultRepo.trim().match(/^([^/\s]+)\/([^/\s]+)$/);e&&p({owner:e[1],repo:e[2]})},[]);let f=(0,eP.useMemo)(()=>m||(t.remoteInfo?.provider==="GitHub"?{owner:t.remoteInfo.owner,repo:t.remoteInfo.name}:null),[t.remoteInfo,m]),[h,g]=(0,eP.useState)(f);(0,eP.useEffect)(()=>{m&&g(m)},[m]);let x=t.remoteInfo?.provider==="GitHub"||!!h,v=[{key:"repository",label:"Repository",Icon:dB,show:!0},{key:"cicd",label:"CI / CD",Icon:cT,show:!0,count:e.workflows.length},{key:"releases",label:"Releases",Icon:cD,show:x}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:v.filter(e=>e.show).map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>a(e.key),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-3 py-1.5 font-mono text-xs transition-colors",i===e.key?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.Icon,{className:"size-3.5"}),e.label,null!=e.count&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1 font-mono text-[10px] tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"releases"===i&&x?(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)(gg,{source:h,detected:f,onChange:g}),h?(0,eT.jsx)(gl,{owner:h.owner,repo:h.repo}):(0,eT.jsx)(s8,{className:"p-6 text-center text-sm text-muted-foreground",children:"Enter a GitHub owner/repo above to load releases."})]}):"cicd"===i?(0,eT.jsx)(gZ,{git:e}):(0,eT.jsx)(gF,{git:e,state:t,issues:l,orderedBranches:u,localBranches:d,remoteBranches:c,showRemote:n,setShowRemote:r,source:h,detected:f,setSource:g,isGithub:x,onOpenDetail:o}),(0,eT.jsx)(gA,{detail:s,remoteInfo:t.remoteInfo,onClose:()=>o(null)})]})}function gZ({git:e}){if(0===e.workflows.length)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(cT,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No CI/CD workflows detected"}),(0,eT.jsxs)("p",{className:"max-w-sm text-pretty text-sm text-muted-foreground",children:["Add a workflow under ",(0,eT.jsx)("span",{className:"font-mono",children:".github/workflows"})," (or a GitLab/CircleCI config) to see jobs, steps, and diagnostics here."]})]})]});let t=e.workflows.filter(e=>"passing"===e.status).length,n=e.workflows.filter(e=>"failing"===e.status).length,r=e.workflows.reduce((e,t)=>e+t.jobs.length,0);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-4",children:[(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Workflows"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:e.workflows.length})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Passing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:"var(--sev-ok)"},children:t})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Failing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:n>0?"var(--sev-critical)":"var(--sev-ok)"},children:n})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Jobs"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:r})]})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cT,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Pipelines"}),(0,eT.jsx)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:"expand a job to inspect its steps"})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-4",children:e.workflows.map(e=>(0,eT.jsx)(gD,{wf:e},e.id))})]})}function gF({git:e,state:t,issues:n,orderedBranches:r,localBranches:i,remoteBranches:a,showRemote:s,setShowRemote:o,source:l,detected:d,setSource:c,isGithub:u,onOpenDetail:m}){let p=(0,eP.useMemo)(()=>t.tagDetails&&t.tagDetails.length>0?t.tagDetails:t.tags.map(e=>({name:e})),[t.tagDetails,t.tags]);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[t.remoteInfo&&(0,eT.jsx)(oS,{title:"Repository",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cz,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"truncate font-mono text-sm text-foreground",children:[t.remoteInfo.owner,"/",t.remoteInfo.name]})]}),(0,eT.jsxs)("a",{href:t.remoteInfo.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm bg-secondary px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary/70",children:[(0,eT.jsx)(oE,{className:"size-3"}),"View on ",t.remoteInfo.provider]})]})}),u&&(0,eT.jsxs)(eT.Fragment,{children:[!d&&(0,eT.jsx)(gg,{source:l,detected:d,onChange:c}),l&&(0,eT.jsx)(gv,{source:l})]}),(0,eT.jsx)(oS,{title:"Working tree",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:t.branch})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-3 font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[(0,eT.jsx)(cC,{className:"size-3.5"})," ",t.ahead]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[(0,eT.jsx)(cA,{className:"size-3.5"})," ",t.behind]}),(0,eT.jsxs)("span",{className:"text-muted-foreground",children:["vs ",t.defaultBranch]})]}),(0,eT.jsx)("button",{type:"button",onClick:()=>m({kind:"commit",commit:t.recentCommits[0]??{...t.lastCommit}}),className:"border-t border-border pt-3 text-left transition-colors hover:opacity-80",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[(0,eT.jsx)(cE,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("p",{className:"truncate text-xs text-foreground",children:t.lastCommit.message}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[t.lastCommit.hash," · ",t.lastCommit.author," · ",t.lastCommit.relative]})]})]})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cP,{className:"size-3.5"})," ",t.contributors," authors"]}),(0,eT.jsxs)("span",{children:[t.totalCommits.toLocaleString()," commits"]})]}),(t.firstCommitRelative||null!=t.trackedFiles)&&(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[t.firstCommitRelative&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(i4,{className:"size-3.5"})," since ",t.firstCommitRelative]}),null!=t.trackedFiles&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(s9,{className:"size-3.5"})," ",t.trackedFiles.toLocaleString()," files"]})]}),(t.stashes>0||t.tags.length>0)&&(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cR,{className:"size-3.5"})," ",t.stashes," ",1===t.stashes?"stash":"stashes"]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cM,{className:"size-3.5"})," ",t.tags.length," tags"]})]})]})}),t.topContributors&&t.topContributors.length>0&&(0,eT.jsx)(oS,{title:"Top contributors",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-2",children:t.topContributors.map(e=>{let n=t.topContributors[0].commits||1;return(0,eT.jsxs)("li",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.commits})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full bg-foreground/40",style:{width:`${e.commits/n*100}%`}})})]},e.name)})})}),(0,eT.jsx)(oS,{title:`Changes (${t.changes.length})`,children:0===t.changes.length?(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"Working tree clean."}):(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:t.changes.map(e=>(0,eT.jsxs)("li",{className:"flex items-center gap-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"w-5 shrink-0 text-center text-[10px]",style:{color:g$[e.status]},children:gS[e.status]}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.path})]},e.path))})}),t.ignored.count>0&&(0,eT.jsx)(oS,{title:`Ignored files (${t.ignored.count})`,children:(0,eT.jsxs)("ul",{className:"flex flex-col gap-1.5",children:[t.ignored.samples.map(e=>(0,eT.jsxs)("li",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(cy,{className:"size-3.5 shrink-0"}),(0,eT.jsx)("span",{className:"truncate",children:e})]},e)),t.ignored.count>t.ignored.samples.length&&(0,eT.jsxs)("li",{className:"font-mono text-[10px] text-muted-foreground",children:["+",t.ignored.count-t.ignored.samples.length," more"]})]})}),(0,eT.jsx)(oS,{title:"Remote",action:t.remote?(0,eT.jsxs)("button",{type:"button",onClick:()=>o(e=>!e),"aria-pressed":s,"aria-label":s?"Hide remote URL":"Reveal remote URL",className:"inline-flex items-center gap-1 rounded-sm px-1 py-0.5 font-mono text-[10px] uppercase text-muted-foreground transition-colors hover:text-foreground",children:[s?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"}),s?"Hide":"Reveal"]}):void 0,children:t.remote?s?(0,eT.jsx)("p",{className:"break-all font-mono text-xs text-foreground",children:t.remote}):(0,eT.jsx)("p",{className:"font-mono text-xs tracking-widest text-muted-foreground","aria-hidden":!0,children:"•".repeat(28)}):(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:"No remote configured"})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[r.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Branches"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[i.length," local · ",a.length," remote"]})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(gL,{branch:e,onOpen:()=>m({kind:"branch",branch:e})},`${e.remote?"r":"l"}-${e.name}`))})]}),t.recentCommits.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cE,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Recent commits"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:t.recentCommits.length})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:t.recentCommits.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>m({kind:"commit",commit:e}),className:"flex w-full items-start gap-3 border-t border-border px-4 py-2.5 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:"mt-0.5 shrink-0 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.hash}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("p",{className:"truncate text-xs text-foreground",children:e.message.split("\n")[0]}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[e.author," · ",e.relative,null!=e.insertions&&(0,eT.jsxs)("span",{className:"ml-2",children:[(0,eT.jsxs)("span",{className:"text-[color:var(--sev-ok)]",children:["+",e.insertions]})," ",(0,eT.jsxs)("span",{className:"text-[color:var(--sev-critical)]",children:["-",e.deletions??0]})]})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]},e.hash))})]}),p.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cM,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Tags"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:p.length})]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:p.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>m({kind:"tag",tag:e}),className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary/70",children:[(0,eT.jsx)(cM,{className:"size-3"}),e.name,e.relative&&(0,eT.jsxs)("span",{className:"text-muted-foreground",children:["· ",e.relative]})]},e.name))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Repository findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:n.length})]}),0===n.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No repository hygiene issues detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:n.map(e=>(0,eT.jsx)(gO,{issue:e},e.id))})]})]})]})}let gB=eL("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);function gV({label:e,value:t,sub:n}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card p-4",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:t}),(0,eT.jsx)("span",{className:"text-xs font-medium text-foreground",children:e}),n&&(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n})]})}function gq({c:e}){return(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:(0,eT.jsxs)("div",{className:"flex items-start gap-3 p-4",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-sm",e.present?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-[color:var(--sev-medium)]/15 text-[color:var(--sev-medium)]"),children:e.present?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(sz,{className:"size-3.5"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:e.name}),e.present?(0,eT.jsx)(lR,{path:e.file,className:"text-[11px]"}):(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground line-through",children:e.file}),null!=e.ruleCount&&(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-[10px]",children:[e.ruleCount," rules"]})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.summary}),e.highlights&&e.highlights.length>0&&(0,eT.jsx)("dl",{className:"mt-3 grid grid-cols-1 gap-px overflow-hidden rounded-sm border border-border bg-border sm:grid-cols-2",children:e.highlights.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 bg-card px-2.5 py-1.5",children:[(0,eT.jsx)("dt",{className:"font-mono text-[11px] text-muted-foreground",children:e.label}),(0,eT.jsx)("dd",{className:(0,ny.cn)("font-mono text-[11px] tabular-nums",!1===e.good?"text-[color:var(--sev-high)]":e.good?"text-[color:var(--sev-ok)]":"text-foreground"),children:e.value})]},e.label))})]})]})})}function gW({setup:e}){let{stats:t}=e,n=[{label:"Code",value:t.codeLoc,color:"var(--chart-1)"},{label:"Comments",value:t.commentLoc,color:"var(--chart-3)"},{label:"Blank",value:t.blankLoc,color:"var(--chart-5)"}],r=t.languages.map(e=>({key:e.language,label:e.language,count:e.loc,hint:`${e.files} files \xb7 ${Math.round(100*e.share)}%`})),i=t.largestFiles.map(e=>({key:e.path,label:e.path,count:e.loc}));return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Tooling detected",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.tooling.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-4 items-center justify-center rounded-[3px]",e.detected?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-secondary text-muted-foreground"),children:e.detected?(0,eT.jsx)(iq,{className:"size-3"}):(0,eT.jsx)(sz,{className:"size-3"})}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.detected?"text-foreground":"text-muted-foreground"),children:e.name})]}),e.version&&(0,eT.jsx)("span",{className:"font-mono text-[10px] tabular-nums text-muted-foreground",children:e.version})]},e.name))})}),(0,eT.jsxs)(oS,{title:"LOC composition",children:[(0,eT.jsx)(o$,{segments:n}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(100*t.commentRatio).toFixed(1),"% comments · ",(100*t.testRatio).toFixed(0),"% test ratio"]})]}),(0,eT.jsx)(oS,{title:"Languages",children:(0,eT.jsx)(oI,{rows:r})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(gB,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Workspace statistics"})]}),(0,eT.jsxs)(s8,{className:"grid grid-cols-2 gap-px overflow-hidden bg-border p-0 sm:grid-cols-3 lg:grid-cols-4",children:[(0,eT.jsx)(gV,{label:"Files",value:t.totalFiles}),(0,eT.jsx)(gV,{label:"Lines of code",value:t.totalLoc.toLocaleString(),sub:`${t.codeLoc.toLocaleString()} code`}),(0,eT.jsx)(gV,{label:"Components",value:t.components}),(0,eT.jsx)(gV,{label:"Routes",value:t.routes}),(0,eT.jsx)(gV,{label:"Test files",value:t.testFiles,sub:`${t.testLoc.toLocaleString()} LOC`}),(0,eT.jsx)(gV,{label:"Comments",value:`${(100*t.commentRatio).toFixed(1)}%`,sub:"of code"}),(0,eT.jsx)(gV,{label:"Test ratio",value:`${(100*t.testRatio).toFixed(0)}%`,sub:"tests : code"}),(0,eT.jsx)(gV,{label:"TODO / FIXME",value:t.todoCount,sub:"markers"})]})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s5,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Largest files"})]}),(0,eT.jsx)(s8,{className:"p-3",children:(0,eT.jsx)(oI,{rows:i})})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eJ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Configuration & rules"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.configs.filter(e=>e.present).length,"/",e.configs.length]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-3",children:e.configs.map(e=>(0,eT.jsx)(gq,{c:e},e.id))})]})]})]})}let gH=eL("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);function gG(e){switch(e){case"pass":return{Icon:iq,color:"var(--sev-ok)",label:"Pass"};case"warn":return{Icon:dw,color:"var(--sev-medium)",label:"Warn"};case"na":return{Icon:lq,color:"var(--muted-foreground)",label:"N/A"};default:return{Icon:sz,color:"var(--sev-critical)",label:"Fail"}}}let gK={excellent:"Excellent",good:"Good","needs-improvement":"Needs improvement",poor:"Poor"};function gJ(e){return e>=80?"var(--sev-ok)":e>=60?"var(--sev-medium)":e>=40?"var(--sev-high)":"var(--sev-critical)"}function gY({score:e,label:t,sub:n}){let r=gJ(e);return(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-2 p-6",children:[(0,eT.jsxs)("div",{className:"relative flex size-28 items-center justify-center",children:[(0,eT.jsxs)("svg",{viewBox:"0 0 100 100",className:"size-full -rotate-90",children:[(0,eT.jsx)("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:"var(--border)",strokeWidth:"8"}),(0,eT.jsx)("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${e/100*264} 264`})]}),(0,eT.jsx)("span",{className:"absolute font-mono text-3xl font-semibold tabular-nums text-foreground",children:e})]}),(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:t}),(0,eT.jsx)("span",{className:"text-center text-xs text-muted-foreground",children:n})]})}function gX({standard:e,active:t,onSelect:n}){let r=gJ(e.score),i=e.checks.filter(e=>"pass"===e.status).length,a=e.checks.filter(e=>"na"!==e.status).length;return(0,eT.jsxs)("button",{type:"button",onClick:n,className:(0,ny.cn)("flex flex-col gap-3 rounded-md border bg-card p-4 text-left transition-colors",t?"border-ring ring-1 ring-ring":"border-border hover:bg-secondary/40"),children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:e.label}),e.liveOnly&&(0,eT.jsx)("span",{className:"shrink-0 rounded-sm border border-border px-1 py-0.5 font-mono text-[9px] uppercase text-muted-foreground",children:"live"})]}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-2 text-pretty text-[11px] leading-snug text-muted-foreground",children:e.tagline})]}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-2xl font-semibold tabular-nums",style:{color:r},children:e.score})]}),(0,eT.jsx)(om,{value:e.score,className:"h-1.5"}),(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:gK[e.band]}),(0,eT.jsxs)("span",{children:[i,"/",a," pass · ",Math.round(100*e.weight),"% wt"]})]})]})}function gQ({check:e,onOpen:t}){let n=gG(e.status);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)(n.Icon,{className:"mt-0.5 size-4 shrink-0",style:{color:n.color}}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),e.agent&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-3"}),"agent"]}),(0,eT.jsx)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:"na"===e.status?"n/a":`+${e.weight}`})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.fix&&(0,eT.jsxs)("p",{className:"mt-1.5 inline-flex items-start gap-1.5 text-pretty text-xs leading-relaxed text-foreground",children:[(0,eT.jsx)(s4,{className:"mt-0.5 size-3 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"line-clamp-1",children:e.fix})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function g0({doc:e}){return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border px-3 py-2.5 first:border-t-0",children:[(0,eT.jsx)(eZ,{className:(0,ny.cn)("size-4 shrink-0",e.present?"text-foreground":"text-muted-foreground")}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[e.present?(0,eT.jsx)(lR,{path:e.path,className:"text-xs"}):(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground line-through",children:e.path}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-1 text-[11px] text-muted-foreground",children:e.note})]}),e.present?(0,eT.jsx)("span",{className:"shrink-0 font-mono text-xs tabular-nums",style:{color:gJ(e.score)},children:e.score}):(0,eT.jsx)("span",{className:"shrink-0 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:"missing"})]})}function g1({standard:e,onOpenCheck:t}){let n=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.checks){let e=n.group??"";t.has(e)||t.set(e,[]),t.get(e).push(n)}return[...t.entries()]},[e.checks]);return(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(eY,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.label}),(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums",style:{color:gJ(e.score)},children:e.score}),(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"ml-auto inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[e.source,(0,eT.jsx)(oE,{className:"size-3"})]})]}),n.map(([n,r])=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[n&&(0,eT.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wider text-muted-foreground",children:n}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(gQ,{check:e,onOpen:()=>t(e)},e.id))})]},n||e.id))]})}function g2({docs:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)(null),a=(0,eP.useMemo)(()=>e.standards.flatMap(e=>e.checks),[e.standards]),s=(0,eP.useMemo)(()=>a.filter(e=>e.agent),[a]),o=a.filter(e=>"pass"===e.status).length,l=a.filter(e=>"na"!==e.status).length,d=s.filter(e=>"pass"===e.status).length,c=s.filter(e=>"na"!==e.status).length,u="all"===t?e.standards:e.standards.filter(e=>e.id===t),m=[{id:"all",label:"All standards"},...e.standards.map(e=>({id:e.id,label:e.label}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(s8,{className:"flex flex-col items-center gap-1 py-0",children:(0,eT.jsx)(gY,{score:e.score,label:`Docs Benchmark \xb7 ${e.grade}`,sub:`${gK[e.band]} — ${o}/${l} checks passing`})}),(0,eT.jsx)(oS,{title:"AI / Agent readiness",action:(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",e.agentReady?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-[color:var(--sev-high)]/15 text-[color:var(--sev-high)]"),children:e.agentReady?"Ready":"Not ready"}),children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-4"})," Agent score"]}),(0,eT.jsxs)("span",{className:"font-mono tabular-nums text-foreground",children:[e.agentScore,"/100"]})]}),(0,eT.jsx)(om,{value:e.agentScore,className:"h-1.5"}),(0,eT.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:[d,"/",c," agent-readiness checks pass across all standards. Adding AGENTS.md and llms.txt has the highest impact."]}),!e.liveUrl&&(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"No live docs URL set. Surface-level checks (robots, sitemap, .md mirrors, MCP) are marked N/A and excluded from scoring."})]})}),(0,eT.jsx)(oS,{title:"Documents",children:(0,eT.jsx)("div",{className:"-mx-3 -mb-3",children:e.documents.map(e=>(0,eT.jsx)(g0,{doc:e},e.path))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Benchmark composition"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.standards.length," standards"]})]}),(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.standards.map(e=>(0,eT.jsx)(gX,{standard:e,active:t===e.id,onSelect:()=>n(t=>t===e.id?"all":e.id)},e.id))})]}),(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:m.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>n(e.id),className:(0,ny.cn)("rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.id?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label},e.id))}),u.map(e=>(0,eT.jsx)(g1,{standard:e,onOpenCheck:t=>i({check:t,standard:e})},e.id))]}),(0,eT.jsx)(g4,{detail:r,onClose:()=>i(null)})]})}function g4({detail:e,onClose:t}){let n=e?.check,r=e?.standard,i=n?gG(n.status):null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:n&&r&&i&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",style:{color:i.color,background:`color-mix(in oklch, ${i.color} 14%, transparent)`},children:[(0,eT.jsx)(i.Icon,{className:"size-3"}),i.label]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:r.label}),n.agent&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-3"}),"agent"]}),n.group&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:n.group})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-sm leading-relaxed",children:n.label}),(0,eT.jsx)(oF,{className:"sr-only",children:"Documentation check detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Status"}),(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums",style:{color:i.color},children:i.label})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Weight"}),(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums text-foreground",children:"na"===n.status?"n/a":`+${n.weight}`})]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(eY,{className:"size-3.5"}),"What this checks"]}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:n.detail})]}),n.fix&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(s4,{className:"size-3.5"}),"How to fix"]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-pretty text-sm leading-relaxed text-foreground",children:n.fix})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(gu,{className:"size-3.5"}),"Standard"]}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card p-3",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:r.label}),(0,eT.jsx)("p",{className:"mt-0.5 text-pretty text-xs leading-relaxed text-muted-foreground",children:r.tagline}),(0,eT.jsxs)("a",{href:r.href,target:"_blank",rel:"noreferrer",className:"mt-2 inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[r.source,(0,eT.jsx)(oE,{className:"size-3"})]})]})]})]})]})})})}let g5={critical:"critical",serious:"high",moderate:"medium",minor:"low"};function g6({violation:e}){let{viewIssue:t}=l$(),n=oV(g5[e.impact]);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o4(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o4(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e.rule}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:e.impact}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.principle})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.help}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"truncate",children:[e.filePath,":",e.line]}),(0,eT.jsxs)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:[e.nodes," node",1===e.nodes?"":"s"]}),e.wcag.filter(e=>/^\d/.test(e)).map(e=>(0,eT.jsxs)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:["WCAG ",e]},e))]})]}),(0,eT.jsx)(lM,{issue:o4(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function g3({accessibility:e}){let[t,n]=(0,eP.useState)("all"),r=(0,eP.useMemo)(()=>[...e.violations].sort((e,t)=>oV(g5[t.impact]).rank-oV(g5[e.impact]).rank),[e.violations]),i=(0,eP.useMemo)(()=>"all"===t?r:r.filter(e=>e.impact===t),[r,t]),a=[{label:"Critical",value:e.counts.critical,color:"var(--chart-1)"},{label:"Serious",value:e.counts.serious,color:"var(--chart-2)"},{label:"Moderate",value:e.counts.moderate,color:"var(--chart-3)"},{label:"Minor",value:e.counts.minor,color:"var(--chart-4)"}],s=e.byPrinciple.map(e=>({key:e.principle,label:e.principle,count:e.count})),o=[{key:"all",label:"All",count:e.violations.length},{key:"critical",label:"Critical",count:e.counts.critical},{key:"serious",label:"Serious",count:e.counts.serious},{key:"moderate",label:"Moderate",count:e.counts.moderate},{key:"minor",label:"Minor",count:e.counts.minor}],l=e.score>=90?"var(--sev-ok)":e.score>=70?"var(--sev-medium)":"var(--sev-high)";return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Accessibility score",children:[(0,eT.jsxs)("div",{className:"flex items-end justify-between",children:[(0,eT.jsx)("span",{className:"font-mono text-4xl font-semibold tabular-nums",style:{color:l},children:e.score}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"out of 100"})]}),(0,eT.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-[color:var(--sev-ok)]",children:e.passes}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"checks passed"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-foreground",children:e.incomplete}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"need review"})]})]})]}),(0,eT.jsx)(oS,{title:"By impact",children:(0,eT.jsx)(o$,{segments:a})}),(0,eT.jsx)(oS,{title:"By WCAG principle",children:(0,eT.jsx)(oI,{rows:s})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:o.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eQ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"WCAG violations"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:i.length}),(0,eT.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(cv,{className:"size-3"}),"axe-core"]})]}),0===i.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No violations in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:i.map(e=>(0,eT.jsx)(g6,{violation:e},e.id))})]})]})}let g9=eL("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),g8={good:"var(--sev-ok)","needs-improvement":"var(--sev-medium)",poor:"var(--sev-high)"},g7={good:"Good","needs-improvement":"Needs work",poor:"Poor"};function xe({vital:e}){let t=g8[e.rating],n=1.5*e.threshold.poor,r=Math.min(100,e.value/n*100),i=Math.min(100,e.threshold.good/n*100),a=Math.min(100,e.threshold.poor/n*100);return(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"font-mono text-xs font-semibold text-foreground",children:e.id}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase",style:{color:t},children:g7[e.rating]})]}),(0,eT.jsxs)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:t},children:[e.value,(0,eT.jsx)("span",{className:"ml-0.5 text-sm text-muted-foreground",children:e.unit})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e.label}),(0,eT.jsxs)("div",{className:"relative mt-1 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:[(0,eT.jsx)("span",{className:"absolute inset-y-0 left-0 bg-[color:var(--sev-ok)]/30",style:{width:`${i}%`},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"absolute inset-y-0 bg-[color:var(--sev-medium)]/30",style:{left:`${i}%`,width:`${a-i}%`},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"absolute top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-card",style:{left:`${r}%`,background:t},"aria-hidden":!0})]})]})}function xt({bundle:e}){let t=g8[e.rating];return(0,eT.jsxs)("li",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-foreground",children:e.route}),(0,eT.jsxs)("span",{className:"shrink-0 font-mono tabular-nums",style:{color:t},children:[e.firstLoadKb," KB"]})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${Math.min(100,e.firstLoadKb/320*100)}%`,background:t}})})]})}function xn({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o5(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o5(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")}),null!=e.estimatedSavingKb&&e.estimatedSavingKb>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(g9,{className:"size-2.5"}),"save ~",e.estimatedSavingKb," KB"]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.title}),(0,eT.jsxs)("span",{className:"mt-1 block truncate font-mono text-[10px] text-muted-foreground",children:[e.filePath,e.line?`:${e.line}`:""]})]}),(0,eT.jsx)(lM,{issue:o5(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function xr({performance:e}){let[t,n]=(0,eP.useState)(!1),r=(0,eP.useMemo)(()=>{let n=[...e.findings].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank);return t?n.filter(e=>(e.estimatedSavingKb??0)>0):n},[e.findings,t]),i=e.findings.reduce((e,t)=>e+(t.estimatedSavingKb??0),0),a=e.score>=90?"var(--sev-ok)":e.score>=50?"var(--sev-medium)":"var(--sev-high)";return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:[(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Perf score"}),(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:a},children:e.score}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"Lighthouse-style"})]}),e.vitals.map(e=>(0,eT.jsx)(xe,{vital:e},e.id))]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"First Load JS by route",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-3",children:e.bundles.map(e=>(0,eT.jsx)(xt,{bundle:e},e.route))})}),(0,eT.jsx)(oS,{title:"Budget",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.totalBundleKb}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"KB shared JS"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-[color:var(--sev-ok)]",children:i}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"KB recoverable"})]})]})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(e0,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Optimization opportunities"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:r.length}),(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:(0,ny.cn)("ml-auto inline-flex items-center gap-1.5 rounded-sm border border-border px-2.5 py-1 font-mono text-[10px] uppercase transition-colors",t?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(eq,{className:"size-3"}),"Has savings"]})]}),0===r.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No optimization opportunities in this view."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(xn,{finding:e},e.id))})]})]})]})}let xi=eL("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);function xa(e){return e>=80?"var(--sev-ok)":e>=50?"var(--sev-medium)":e>0?"var(--sev-high)":"var(--sev-critical)"}function xs({label:e,value:t}){let n=xa(t);return(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:"font-mono tabular-nums",style:{color:n},children:[t,"%"]})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${t}%`,background:n}})})]})}function xo({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o6(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o6(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.title}),(0,eT.jsxs)("span",{className:"mt-1 block truncate font-mono text-[10px] text-muted-foreground",children:[e.filePath,e.line?`:${e.line}`:""]})]}),(0,eT.jsx)(lM,{issue:o6(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function xl({suite:e,expanded:t,onToggle:n}){let r="failed"===e.status,i=e.tests??[];return(0,eT.jsxs)("div",{className:"border-t border-border first:border-t-0",children:[(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},className:"flex w-full cursor-pointer items-center justify-between gap-3 p-4 transition-colors hover:bg-secondary/40",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,eT.jsx)("div",{className:"inline-flex size-4 shrink-0 items-center justify-center",children:(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})}),r?(0,eT.jsx)(i5,{className:"size-4 shrink-0 text-[color:var(--sev-critical)]"}):(0,eT.jsx)(da,{className:"size-4 shrink-0 text-[color:var(--sev-ok)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block truncate font-mono text-sm text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:e.filePath})]})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] tabular-nums",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(da,{className:"size-3"}),e.passed]}),e.failed>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-[color:var(--sev-critical)]",children:[(0,eT.jsx)(i5,{className:"size-3"}),e.failed]}),e.skipped>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(xi,{className:"size-3"}),e.skipped]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(i4,{className:"size-3"}),(e.durationMs/1e3).toFixed(1),"s"]})]})]}),t&&i.length>0&&(0,eT.jsx)("div",{className:"border-t border-border/50 bg-secondary/20",children:(0,eT.jsx)("div",{className:"flex flex-col divide-y divide-border/50",children:i.map(e=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2 p-3 font-mono text-xs",children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:["passed"===e.status?(0,eT.jsx)(da,{className:"size-3.5 shrink-0 text-[color:var(--sev-ok)]"}):"failed"===e.status?(0,eT.jsx)(i5,{className:"size-3.5 shrink-0 text-[color:var(--sev-critical)]"}):(0,eT.jsx)(xi,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)("truncate font-medium","failed"===e.status?"text-foreground":"text-muted-foreground"),children:e.name})]}),null!=e.durationMs&&(0,eT.jsxs)("span",{className:"shrink-0 text-muted-foreground/70",children:[(e.durationMs/1e3).toFixed(2),"s"]})]}),e.error&&(0,eT.jsx)("div",{className:"ml-5 rounded-sm border border-[color:var(--sev-critical)]/20 bg-[color:var(--sev-critical)]/5 px-2 py-1.5 text-[10px]",children:(0,eT.jsx)("div",{className:"font-semibold text-[color:var(--sev-critical)]",children:e.error})}),e.assertions&&e.assertions.length>0&&(0,eT.jsx)("div",{className:"ml-5 flex flex-col gap-1",children:e.assertions.map((e,t)=>(0,eT.jsxs)("div",{className:"flex items-start gap-2 text-muted-foreground/80",children:[(0,eT.jsx)("span",{className:"mt-0.5 inline-flex size-1.5 shrink-0 rounded-full bg-current"}),(0,eT.jsx)("span",{className:"truncate",children:e})]},t))})]},e.name))})})]})}function xd({file:e}){let t=xa(e.lines);return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border p-4 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block truncate font-mono text-sm text-foreground",children:e.filePath}),(0,eT.jsx)("div",{className:"mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${e.lines}%`,background:t}})})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 flex-col items-end",children:[(0,eT.jsxs)("span",{className:"font-mono text-sm tabular-nums",style:{color:t},children:[e.lines,"%"]}),(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:"lines"})]})]})}function xc({tests:e}){let[t,n]=(0,eP.useState)("findings"),[r,i]=(0,eP.useState)(new Set),a=(0,eP.useMemo)(()=>[...e.findings].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank),[e.findings]),s=(0,eP.useMemo)(()=>[...e.suites].sort((e,t)=>t.failed-e.failed||t.durationMs-e.durationMs),[e.suites]),o=(0,eP.useMemo)(()=>[...e.files].sort((e,t)=>e.lines-t.lines),[e.files]),l=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0,d=[{key:"findings",label:"Findings",count:a.length},{key:"suites",label:"Suites",count:s.length},{key:"coverage",label:"Coverage",count:o.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Pass rate"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:e.counts.failed>0?"var(--sev-high)":"var(--sev-ok)"},children:[l,"%"]}),(0,eT.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.counts.passed,"/",e.counts.total," passing · ",e.counts.skipped," skipped"]})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Failing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:e.counts.failed>0?"var(--sev-critical)":"var(--sev-ok)"},children:e.counts.failed}),(0,eT.jsxs)("span",{className:"text-xs text-muted-foreground",children:["across ",e.counts.suites," suites"]})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Line coverage"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:xa(e.coverage.lines)},children:[e.coverage.lines,"%"]}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:e.framework})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Duration"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:[(e.counts.durationMs/1e3).toFixed(1),"s"]}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"full suite run"})]})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsx)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:(0,eT.jsx)(oS,{title:"Coverage breakdown",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsx)(xs,{label:"Lines",value:e.coverage.lines}),(0,eT.jsx)(xs,{label:"Functions",value:e.coverage.functions}),(0,eT.jsx)(xs,{label:"Branches",value:e.coverage.branches}),(0,eT.jsx)(xs,{label:"Statements",value:e.coverage.statements})]})})}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:d.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e1,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"findings"===t?"Test findings":"suites"===t?"Test suites":"Lowest coverage files"})]}),"findings"===t&&(0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No test findings — suite is healthy."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>(0,eT.jsx)(xo,{finding:e},e.id))})),"suites"===t&&(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:s.map(e=>(0,eT.jsx)(xl,{suite:e,expanded:r.has(e.id),onToggle:()=>{var t;let n;return t=e.id,void((n=new Set(r)).has(t)?n.delete(t):n.add(t),i(n))}},e.id))}),"coverage"===t&&(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:o.map(e=>(0,eT.jsx)(xd,{file:e},e.filePath))})]})]})]})}let xu=eL("sun-moon",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);var xm=/[\\\/_+.#"@\[\(\{&]/,xp=/[\\\/_+.#"@\[\(\{&]/g,xf=/[\s-]/,xh=/[\s-]/g;function xg(e){return e.toLowerCase().replace(xh," ")}function xx(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function xv(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function xy(...e){return t=>{let n=!1,r=e.map(e=>{let r=xv(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():xv(e[t],null)}}}}function xb(...e){return eP.useCallback(xy(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var xk=globalThis?.document?eP.useLayoutEffect:()=>{},xj=eP[" useId ".trim().toString()]||(()=>void 0),xw=0;function xN(e){let[t,n]=eP.useState(xj());return xk(()=>{e||n(e=>e??String(xw++))},[e]),e||(t?`radix-${t}`:"")}eP[" useEffectEvent ".trim().toString()],eP[" useInsertionEffect ".trim().toString()];var x_=eP[" useInsertionEffect ".trim().toString()]||xk;function xS(e){let t=eP.forwardRef((t,n)=>{var r;let i,a,{children:s,...o}=t,l=null,d=!1,c=[];xC(s)&&"function"==typeof xP&&(s=xP(s._payload)),eP.Children.forEach(s,e=>{var t;if(t=e,eP.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===x$){d=!0;let t="child"in e.props?e.props.child:e.props.children;xC(t)&&"function"==typeof xP&&(t=xP(t._payload)),l=xI(e,t),c.push(l?.props?.children)}else c.push(e)}),l?l=eP.cloneElement(l,void 0,c):!d&&1===eP.Children.count(s)&&eP.isValidElement(s)&&(l=s);let u=l?(r=l,(a=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(a=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,m=xb(n,u);if(!l){if(s||0===s)throw Error(d?xT(e):xA(e));return s}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}(o,l.props??{});return l.type!==eP.Fragment&&(p.ref=n?m:u),eP.cloneElement(l,p)});return t.displayName=`${e}.Slot`,t}Symbol("RADIX:SYNC_STATE");var x$=Symbol.for("radix.slottable"),xI=(e,t)=>{if("child"in e.props){let t=e.props.child;return eP.isValidElement(t)?eP.cloneElement(t,void 0,e.props.children(t.props.children)):null}return eP.isValidElement(t)?t:null},xE=Symbol.for("react.lazy");function xC(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===xE&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var xA=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,xT=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,xP=eP[" use ".trim().toString()],xz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=xS(`Primitive.${t}`),r=eP.forwardRef((e,r)=>{let{asChild:i,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,eT.jsx)(i?n:t,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xO(e){let t=eP.useRef(e);return eP.useEffect(()=>{t.current=e}),eP.useMemo(()=>(...e)=>t.current?.(...e),[])}var xM="dismissableLayer.update",xR=eP.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),xD=eP.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:o,onDismiss:l,...d}=e,c=eP.useContext(xR),[u,m]=eP.useState(null),p=u?.ownerDocument??globalThis?.document,[,f]=eP.useState({}),h=xb(t,e=>m(e)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=u?g.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,k=y>=v,j=eP.useRef(!1),w=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,s=xO(e),o=eP.useRef(!1),l=eP.useRef(!1),d=eP.useRef(new Map),c=eP.useRef(()=>{});return eP.useEffect(()=>{function e(){l.current=!1,i.current=!1,d.current.clear()}function t(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{l.current&&c.current()},0)}function u(e){l.current&&d.current.set(e.type,!1)}let m=t=>{if(t.target&&!o.current){let a=function(){n.removeEventListener("click",c.current);let t=Array.from(d.current.values()).some(Boolean);e(),t||xU("dismissableLayer.pointerDownOutside",s,o,{discrete:!0})},o={originalEvent:t};l.current=!0,i.current=r&&0===t.button,d.current.clear(),r&&0===t.button?(n.removeEventListener("click",c.current),c.current=a,n.addEventListener("click",c.current,{once:!0})):a()}else n.removeEventListener("click",c.current),e();o.current=!1},p=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of p)n.addEventListener(e,t,!0),n.addEventListener(e,u);let f=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{for(let e of(window.clearTimeout(f),n.removeEventListener("pointerdown",m),n.removeEventListener("click",c.current),p))n.removeEventListener(e,t,!0),n.removeEventListener(e,u)}},[n,s,r,i,a]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...c.branches].some(e=>e.contains(t));k&&!n&&(a?.(e),o?.(e),e.defaultPrevented||l?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:j,dismissableSurfaces:c.dismissableSurfaces}),N=function(e,t=globalThis?.document){let n=xO(e),r=eP.useRef(!1);return eP.useEffect(()=>{let e=e=>{e.target&&!r.current&&xU("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(r&&j.current)return;let t=e.target;![...c.branches].some(e=>e.contains(t))&&(s?.(e),o?.(e),e.defaultPrevented||l?.())},p);return!function(e,t=globalThis?.document){let n=xO(e);eP.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===c.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),eP.useEffect(()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(I=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),xL(),()=>{n&&(c.layersWithOutsidePointerEventsDisabled.delete(u),0===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=I))}},[u,p,n,c]),eP.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),xL())},[u,c]),eP.useEffect(()=>{let e=()=>f({});return document.addEventListener(xM,e),()=>document.removeEventListener(xM,e)},[]),(0,eT.jsx)(xz.div,{...d,ref:h,style:{pointerEvents:b?k?"auto":"none":void 0,...e.style},onFocusCapture:xx(e.onFocusCapture,N.onFocusCapture),onBlurCapture:xx(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:xx(e.onPointerDownCapture,w.onPointerDownCapture)})});function xL(){let e=new CustomEvent(xM);document.dispatchEvent(e)}function xU(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&aG.flushSync(()=>i.dispatchEvent(a));else i.dispatchEvent(a)}xD.displayName="DismissableLayer",eP.forwardRef((e,t)=>{let n=eP.useContext(xR),r=eP.useRef(null),i=xb(t,r);return eP.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,eT.jsx)(xz.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var xZ="focusScope.autoFocusOnMount",xF="focusScope.autoFocusOnUnmount",xB={bubbles:!1,cancelable:!0},xV=eP.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[o,l]=eP.useState(null),d=xO(i),c=xO(a),u=eP.useRef(null),m=xb(t,e=>l(e)),p=eP.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;eP.useEffect(()=>{if(r){let e=function(e){if(p.paused||!o)return;let t=e.target;o.contains(t)?u.current=t:xH(u.current,{select:!0})},t=function(e){if(p.paused||!o)return;let t=e.relatedTarget;null!==t&&(o.contains(t)||xH(u.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xH(o)});return o&&n.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,o,p.paused]),eP.useEffect(()=>{if(o){xG.add(p);let e=document.activeElement;if(!o.contains(e)){let t=new CustomEvent(xZ,xB);o.addEventListener(xZ,d),o.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xH(r,{select:t}),document.activeElement!==n)return}(xq(o).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&xH(o))}return()=>{o.removeEventListener(xZ,d),setTimeout(()=>{let t=new CustomEvent(xF,xB);o.addEventListener(xF,c),o.dispatchEvent(t),t.defaultPrevented||xH(e??document.body,{select:!0}),o.removeEventListener(xF,c),xG.remove(p)},0)}}},[o,d,c,p]);let f=eP.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){var a;let t,r=e.currentTarget,[s,o]=[xW(t=xq(a=r),a),xW(t.reverse(),a)];s&&o?e.shiftKey||i!==o?e.shiftKey&&i===s&&(e.preventDefault(),n&&xH(o,{select:!0})):(e.preventDefault(),n&&xH(s,{select:!0})):i===r&&e.preventDefault()}},[n,r,p.paused]);return(0,eT.jsx)(xz.div,{tabIndex:-1,...s,ref:m,onKeyDown:f})});function xq(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xW(e,t){for(let n of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function xH(e,{select:t=!1}={}){if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}xV.displayName="FocusScope";var xG=(r=[],{add(e){let t=r[0];e!==t&&t?.pause(),(r=xK(r,e)).unshift(e)},remove(e){r=xK(r,e),r[0]?.resume()}});function xK(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var xJ=eP.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=eP.useState(!1);xk(()=>a(!0),[]);let s=n||i&&globalThis?.document?.body;return s?aG.createPortal((0,eT.jsx)(xz.div,{...r,ref:t}),s):null});xJ.displayName="Portal";var xY=e=>{var t;let n,r,{present:i,children:a}=e,s=function(e){var t,n;let[r,i]=eP.useState(),a=eP.useRef(null),s=eP.useRef(e),o=eP.useRef("none"),[l,d]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},eP.useReducer((e,t)=>n[e][t]??e,t));return eP.useEffect(()=>{let e=xQ(a.current);o.current="mounted"===l?e:"none"},[l]),xk(()=>{let t=a.current,n=s.current;if(n!==e){let r=o.current,i=xQ(t);e?d("MOUNT"):"none"===i||t?.display==="none"?d("UNMOUNT"):n&&r!==i?d("ANIMATION_OUT"):d("UNMOUNT"),s.current=e}},[e,d]),xk(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=xQ(a.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(d("ANIMATION_END"),!s.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(o.current=xQ(a.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}d("ANIMATION_END")},[r,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:eP.useCallback(e=>{a.current=e?getComputedStyle(e):null,i(e)},[])}}(i),o="function"==typeof a?a({present:s.isPresent}):eP.Children.only(a),l=function(...e){let t=eP.useRef(e);return t.current=e,eP.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=xX(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():xX(n[e],null)}}},[])}(s.ref,(t=o,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof a||s.isPresent?eP.cloneElement(o,{ref:l}):null};function xX(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function xQ(e){return e?.animationName||"none"}xY.displayName="Presence";var x0=0,x1=null;function x2(){let 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 x4=function(){return(x4=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function x5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var x6=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),x3="width-before-scroll-bar";function x9(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var x8="u">typeof window?eP.useLayoutEffect:eP.useEffect,x7=new WeakMap,ve=(void 0===h&&(h={}),(void 0===g&&(g=function(e){return e}),x=[],v=!1,y={read:function(){if(v)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return x.length?x[x.length-1]:null},useMedium:function(e){var t=g(e,v);return x.push(t),function(){x=x.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(v=!0;x.length;){var t=x;x=[],t.forEach(e)}x={push:function(t){return e(t)},filter:function(){return x}}},assignMedium:function(e){v=!0;var t=[];if(x.length){var n=x;x=[],n.forEach(e),t=x}var r=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(r)};i(),x={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),x}}}}).options=x4({async:!0,ssr:!1},h),y),vt=function(){},vn=eP.forwardRef(function(e,t){var n,r,i,a,s=eP.useRef(null),o=eP.useState({onScrollCapture:vt,onWheelCapture:vt,onTouchMoveCapture:vt}),l=o[0],d=o[1],c=e.forwardProps,u=e.children,m=e.className,p=e.removeScrollBar,f=e.enabled,h=e.shards,g=e.sideCar,x=e.noRelative,v=e.noIsolation,y=e.inert,b=e.allowPinchZoom,k=e.as,j=e.gapMode,w=x5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=(n=[s,t],r=function(e){return n.forEach(function(t){return x9(t,e)})},(i=(0,eP.useState)(function(){return{value:null,callback:r,facade:{get current(){return i.value},set current(value){var e=i.value;e!==value&&(i.value=value,i.callback(value,e))}}}})[0]).callback=r,a=i.facade,x8(function(){var e=x7.get(a);if(e){var t=new Set(e),r=new Set(n),i=a.current;t.forEach(function(e){r.has(e)||x9(e,null)}),r.forEach(function(e){t.has(e)||x9(e,i)})}x7.set(a,n)},[n]),a),_=x4(x4({},w),l);return eP.createElement(eP.Fragment,null,f&&eP.createElement(g,{sideCar:ve,removeScrollBar:p,shards:h,noRelative:x,noIsolation:v,inert:y,setCallbacks:d,allowPinchZoom:!!b,lockRef:s,gapMode:j}),c?eP.cloneElement(eP.Children.only(u),x4(x4({},_),{ref:N})):eP.createElement(void 0===k?"div":k,x4({},_,{className:m,ref:N}),u))});vn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vn.classNames={fullWidth:x3,zeroRight:x6};var vr=function(e){var t=e.sideCar,n=x5(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return eP.createElement(r,x4({},n))};vr.isSideCarExport=!0;var vi=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=E||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,i;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},va=function(){var e=vi();return function(t,n){eP.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vs=function(){var e=va();return function(t){return e(t.styles,t.dynamic),null}},vo={left:0,top:0,right:0,gap:0},vl=function(e){return parseInt(e||"",10)||0},vd=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[vl(n),vl(r),vl(i)]},vc=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return vo;var t=vd(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])}},vu=vs(),vm="data-scroll-locked",vp=function(e,t,n,r){var i=e.left,a=e.top,s=e.right,o=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(o,"px ").concat(r,";\n }\n body[").concat(vm,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(x6," {\n right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(x3," {\n margin-right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(x6," .").concat(x6," {\n right: 0 ").concat(r,";\n }\n \n .").concat(x3," .").concat(x3," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(vm,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},vf=function(){var e=parseInt(document.body.getAttribute(vm)||"0",10);return isFinite(e)?e:0},vh=function(){eP.useEffect(function(){return document.body.setAttribute(vm,(vf()+1).toString()),function(){var e=vf()-1;e<=0?document.body.removeAttribute(vm):document.body.setAttribute(vm,e.toString())}},[])},vg=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;vh();var a=eP.useMemo(function(){return vc(i)},[i]);return eP.createElement(vu,{styles:vp(a,!t,i,n?"":"!important")})},vx=!1;if("u">typeof window)try{var vv=Object.defineProperty({},"passive",{get:function(){return vx=!0,!0}});window.addEventListener("test",vv,vv),window.removeEventListener("test",vv,vv)}catch(e){vx=!1}var vy=!!vx&&{passive:!1},vb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},vk=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),vj(e,r)){var i=vw(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},vj=function(e,t){return"v"===e?vb(t,"overflowY"):vb(t,"overflowX")},vw=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},vN=function(e,t,n,r,i){var a,s=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),o=s*r,l=n.target,d=t.contains(l),c=!1,u=o>0,m=0,p=0;do{if(!l)break;var f=vw(e,l),h=f[0],g=f[1]-f[2]-s*h;(h||g)&&vj(e,l)&&(m+=g,p+=h);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!d&&l!==document.body||d&&(t.contains(l)||t===l))return u&&(i&&1>Math.abs(m)||!i&&o>m)?c=!0:!u&&(i&&1>Math.abs(p)||!i&&-o>p)&&(c=!0),c},v_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vS=function(e){return[e.deltaX,e.deltaY]},v$=function(e){return e&&"current"in e?e.current:e},vI=0,vE=[];let vC=(b=function(e){var t=eP.useRef([]),n=eP.useRef([0,0]),r=eP.useRef(),i=eP.useState(vI++)[0],a=eP.useState(vs)[0],s=eP.useRef(e);eP.useEffect(function(){s.current=e},[e]),eP.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(v$),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=eP.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var i,a=v_(e),o=n.current,l="deltaX"in e?e.deltaX:o[0]-a[0],d="deltaY"in e?e.deltaY:o[1]-a[1],c=e.target,u=Math.abs(l)>Math.abs(d)?"h":"v";if("touches"in e&&"h"===u&&"range"===c.type)return!1;var m=window.getSelection(),p=m&&m.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var f=vk(u,c);if(!f)return!0;if(f?i=u:(i="v"===u?"h":"v",f=vk(u,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||d)&&(r.current=i),!i)return!0;var h=r.current||i;return vN(h,t,e,"h"===h?l:d,!0)},[]),l=eP.useCallback(function(e){if(vE.length&&vE[vE.length-1]===a){var n="deltaY"in e?vS(e):v_(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var i=(s.current.shards||[]).map(v$).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?o(e,i[0]):!s.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),d=eP.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),c=eP.useCallback(function(e){n.current=v_(e),r.current=void 0},[]),u=eP.useCallback(function(t){d(t.type,vS(t),t.target,o(t,e.lockRef.current))},[]),m=eP.useCallback(function(t){d(t.type,v_(t),t.target,o(t,e.lockRef.current))},[]);eP.useEffect(function(){return vE.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,vy),document.addEventListener("touchmove",l,vy),document.addEventListener("touchstart",c,vy),function(){vE=vE.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,vy),document.removeEventListener("touchmove",l,vy),document.removeEventListener("touchstart",c,vy)}},[]);var p=e.removeScrollBar,f=e.inert;return eP.createElement(eP.Fragment,null,f?eP.createElement(a,{styles:"\n .block-interactivity-".concat(i," {pointer-events: none;}\n .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,p?eP.createElement(vg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ve.useMedium(b),vr);var vA=eP.forwardRef(function(e,t){return eP.createElement(vn,x4({},e,{ref:t,sideCar:vC}))});vA.classNames=vn.classNames;var vT=new WeakMap,vP=new WeakMap,vz={},vO=0,vM=function(e){return e&&(e.host||vM(e.parentNode))},vR=function(e,t,n,r){var i=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=vM(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});vz[n]||(vz[n]=new WeakMap);var a=vz[n],s=[],o=new Set,l=new Set(i),d=function(e){!e||o.has(e)||(o.add(e),d(e.parentNode))};i.forEach(d);var c=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(o.has(e))c(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,l=(vT.get(e)||0)+1,d=(a.get(e)||0)+1;vT.set(e,l),a.set(e,d),s.push(e),1===l&&i&&vP.set(e,!0),1===d&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),o.clear(),vO++,function(){s.forEach(function(e){var t=vT.get(e)-1,i=a.get(e)-1;vT.set(e,t),a.set(e,i),t||(vP.has(e)||e.removeAttribute(r),vP.delete(e)),i||e.removeAttribute(n)}),--vO||(vT=new WeakMap,vT=new WeakMap,vP=new WeakMap,vz={})}},vD=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),vR(r,i,n,"aria-hidden")):function(){return null}},vL="Dialog",[vU,vZ]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>eP.createContext(e));return function(n){let r=n?.[e]||t;return eP.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=eP.createContext(r);i.displayName=t+"Context";let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,o=n?.[e]?.[a]||i,l=eP.useMemo(()=>s,Object.values(s));return(0,eT.jsx)(o.Provider,{value:l,children:r})};return s.displayName=t+"Provider",[s,function(n,s){let o=s?.[e]?.[a]||i,l=eP.useContext(o);if(l)return l;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return eP.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(vL),[vF,vB]=vU(vL),vV=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,o=eP.useRef(null),l=eP.useRef(null),[d,c]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=function({defaultProp:e,onChange:t}){let[n,r]=eP.useState(e),i=eP.useRef(n),a=eP.useRef(t);return x_(()=>{a.current=t},[t]),eP.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}({defaultProp:t,onChange:n}),o=void 0!==e,l=o?e:i;{let t=eP.useRef(void 0!==e);eP.useEffect(()=>{let e=t.current;if(e!==o){let t=o?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. 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.`)}t.current=o},[o,r])}return[l,eP.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&s.current?.(n)}else a(t)},[o,e,a,s])]}({prop:r,defaultProp:i??!1,onChange:a,caller:vL});return(0,eT.jsx)(vF,{scope:t,triggerRef:o,contentRef:l,contentId:xN(),titleId:xN(),descriptionId:xN(),open:d,onOpenChange:c,onOpenToggle:eP.useCallback(()=>c(e=>!e),[c]),modal:s,children:n})};vV.displayName=vL;var vq="DialogTrigger";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(vq,n),a=xb(t,i.triggerRef);return(0,eT.jsx)(xz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":v8(i.open),...r,ref:a,onClick:xx(e.onClick,i.onOpenToggle)})}).displayName=vq;var vW="DialogPortal",[vH,vG]=vU(vW,{forceMount:void 0}),vK=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=vB(vW,t);return(0,eT.jsx)(vH,{scope:t,forceMount:n,children:eP.Children.map(r,e=>(0,eT.jsx)(xY,{present:n||a.open,children:(0,eT.jsx)(xJ,{asChild:!0,container:i,children:e})}))})};vK.displayName=vW;var vJ="DialogOverlay",vY=eP.forwardRef((e,t)=>{let n=vG(vJ,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=vB(vJ,e.__scopeDialog);return a.modal?(0,eT.jsx)(xY,{present:r||a.open,children:(0,eT.jsx)(vQ,{...i,ref:t})}):null});vY.displayName=vJ;var vX=xS("DialogOverlay.RemoveScroll"),vQ=eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(vJ,n),a=xb(t,function(){let e=eP.useContext(xR),[t,n]=eP.useState(null);return eP.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}());return(0,eT.jsx)(vA,{as:vX,allowPinchZoom:!0,shards:[i.contentRef],children:(0,eT.jsx)(xz.div,{"data-state":v8(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),v0="DialogContent",v1=eP.forwardRef((e,t)=>{let n=vG(v0,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=vB(v0,e.__scopeDialog);return(0,eT.jsx)(xY,{present:r||a.open,children:a.modal?(0,eT.jsx)(v2,{...i,ref:t}):(0,eT.jsx)(v4,{...i,ref:t})})});v1.displayName=v0;var v2=eP.forwardRef((e,t)=>{let n=vB(v0,e.__scopeDialog),r=eP.useRef(null),i=xb(t,n.contentRef,r);return eP.useEffect(()=>{let e=r.current;if(e)return vD(e)},[]),(0,eT.jsx)(v5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:xx(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:xx(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:xx(e.onFocusOutside,e=>e.preventDefault())})}),v4=eP.forwardRef((e,t)=>{let n=vB(v0,e.__scopeDialog),r=eP.useRef(!1),i=eP.useRef(!1);return(0,eT.jsx)(v5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),v5=eP.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,o=vB(v0,n);return eP.useEffect(()=>{x1||(x1={start:x2(),end:x2()});let{start:e,end:t}=x1;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),x0++,()=>{1===x0&&(x1?.start.remove(),x1?.end.remove(),x1=null),x0=Math.max(0,x0-1)}},[]),(0,eT.jsx)(eT.Fragment,{children:(0,eT.jsx)(xV,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,eT.jsx)(xD,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":v8(o.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>o.onOpenChange(!1)})})})}),v6="DialogTitle";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v6,n);return(0,eT.jsx)(xz.h2,{id:i.titleId,...r,ref:t})}).displayName=v6;var v3="DialogDescription";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v3,n);return(0,eT.jsx)(xz.p,{id:i.descriptionId,...r,ref:t})}).displayName=v3;var v9="DialogClose";function v8(e){return e?"open":"closed"}eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v9,n);return(0,eT.jsx)(xz.button,{type:"button",...r,ref:t,onClick:xx(e.onClick,()=>i.onOpenChange(!1))})}).displayName=v9;var v7='[cmdk-group=""]',ye='[cmdk-group-items=""]',yt='[cmdk-item=""]',yn=`${yt}:not([aria-disabled="true"])`,yr="cmdk-item-select",yi="data-value",ya=(e,t,n)=>{var r;return r=e,function e(t,n,r,i,a,s,o){if(s===n.length)return a===t.length?1:.99;var l=`${a},${s}`;if(void 0!==o[l])return o[l];for(var d,c,u,m,p=i.charAt(s),f=r.indexOf(p,a),h=0;f>=0;)(d=e(t,n,r,i,f+1,s+1,o))>h&&(f===a?d*=1:xm.test(t.charAt(f-1))?(d*=.8,(u=t.slice(a,f-1).match(xp))&&a>0&&(d*=Math.pow(.999,u.length))):xf.test(t.charAt(f-1))?(d*=.9,(m=t.slice(a,f-1).match(xh))&&a>0&&(d*=Math.pow(.999,m.length))):(d*=.17,a>0&&(d*=Math.pow(.999,f-a))),t.charAt(f)!==n.charAt(s)&&(d*=.9999)),(d<.1&&r.charAt(f-1)===i.charAt(s+1)||i.charAt(s+1)===i.charAt(s)&&r.charAt(f-1)!==i.charAt(s))&&.1*(c=e(t,n,r,i,f+1,s+2,o))>d&&(d=.1*c),d>h&&(h=d),f=r.indexOf(p,f+1);return o[l]=h,h}(r=n&&n.length>0?`${r+" "+n.join(" ")}`:r,t,xg(r),xg(t),0,0,{})},ys=eP.createContext(void 0),yo=eP.createContext(void 0),yl=eP.createContext(void 0),yd=eP.forwardRef((e,t)=>{let n=yy(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=yy(()=>new Set),i=yy(()=>new Map),a=yy(()=>new Map),s=yy(()=>new Set),o=yx(e),{label:l,children:d,value:c,onValueChange:u,filter:m,shouldFilter:p,loop:f,disablePointerSelection:h=!1,vimBindings:g=!0,...x}=e,v=xN(),y=xN(),b=xN(),k=eP.useRef(null),j=yj();yv(()=>{if(void 0!==c){let e=c.trim();n.current.value=e,w.emit()}},[c]),yv(()=>{j(6,E)},[]);let w=eP.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,s,l;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)I(),S(),j(1,$);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(b);e?e.focus():null==(i=document.getElementById(v))||i.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=C())?void 0:e.id,w.emit()}),r||j(5,E),(null==(a=o.current)?void 0:a.value)!==void 0){null==(l=(s=o.current).onValueChange)||l.call(s,null!=t?t:"");return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),N=eP.useMemo(()=>({value:(e,t,r)=>{var i;t!==(null==(i=a.current.get(e))?void 0:i.value)&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,_(t,r)),j(2,()=>{S(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),j(3,()=>{I(),S(),n.current.value||$(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=C();j(4,()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&$(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:k}),[]);function _(e,t){var r,i;let a=null!=(i=null==(r=o.current)?void 0:r.filter)?i:ya;return e?a(e,n.current.search,t):0}function S(){if(!n.current.search||!1===o.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{a=Math.max(e.get(t),a)}),t.push([n,a])});let r=k.current;A().sort((t,n)=>{var r,i;let a=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(i=e.get(a))?i:0)}).forEach(e=>{let t=e.closest(ye);t?t.appendChild(e.parentElement===t?e:e.closest(`${ye} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ye} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${v7}[${yi}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function $(){let e=A().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(yi);w.setState("value",t||void 0)}function I(){var e,t,s,l;if(!n.current.search||!1===o.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let d=0;for(let i of r.current){let r=_(null!=(t=null==(e=a.current.get(i))?void 0:e.value)?t:"",null!=(l=null==(s=a.current.get(i))?void 0:s.keywords)?l:[]);n.current.filtered.items.set(i,r),r>0&&d++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=d}function E(){var e,t,n;let r=C();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(v7))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function C(){var e;return null==(e=k.current)?void 0:e.querySelector(`${yt}[aria-selected="true"]`)}function A(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(yn))||[])}function T(e){let t=A()[e];t&&w.setState("value",t.getAttribute(yi))}function P(e){var t;let n=C(),r=A(),i=r.findIndex(e=>e===n),a=r[i+e];null!=(t=o.current)&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState("value",a.getAttribute(yi))}function z(e){let t=C(),n=null==t?void 0:t.closest(v7),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,v7):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,v7))?void 0:n.querySelector(yn);r?w.setState("value",r.getAttribute(yi)):P(e)}let O=()=>T(A().length-1),M=e=>{e.preventDefault(),e.metaKey?O():e.altKey?z(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?T(0):e.altKey?z(-1):P(-1)};return eP.createElement(xz.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":g&&e.ctrlKey&&M(e);break;case"ArrowDown":M(e);break;case"p":case"k":g&&e.ctrlKey&&R(e);break;case"ArrowUp":R(e);break;case"Home":e.preventDefault(),T(0);break;case"End":e.preventDefault(),O();break;case"Enter":{e.preventDefault();let t=C();if(t){let e=new Event(yr);t.dispatchEvent(e)}}}}},eP.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:yN},l),yw(e,e=>eP.createElement(yo.Provider,{value:w},eP.createElement(ys.Provider,{value:N},e))))}),yc=eP.forwardRef((e,t)=>{var n,r;let i=xN(),a=eP.useRef(null),s=eP.useContext(yl),o=eP.useContext(ys),l=yx(e),d=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==s?void 0:s.forceMount;yv(()=>{if(!d)return o.item(i,null==s?void 0:s.id)},[d]);let c=yk(i,a,[e.value,e.children,a],e.keywords),u=eP.useContext(yo),m=yb(e=>e.value&&e.value===c.current),p=yb(e=>!!d||!1===o.filter()||!e.search||e.filtered.items.get(i)>0);function f(){var e,t;h(),null==(t=(e=l.current).onSelect)||t.call(e,c.current)}function h(){u.setState("value",c.current,!0)}if(eP.useEffect(()=>{let t=a.current;if(!(!t||e.disabled))return t.addEventListener(yr,f),()=>t.removeEventListener(yr,f)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:x,onSelect:v,forceMount:y,keywords:b,...k}=e;return eP.createElement(xz.div,{ref:xy(a,t),...k,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!m,"data-disabled":!!g,"data-selected":!!m,onPointerMove:g||o.getDisablePointerSelection()?void 0:h,onClick:g?void 0:f},e.children)}),yu=eP.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,s=xN(),o=eP.useRef(null),l=eP.useRef(null),d=xN(),c=eP.useContext(ys),u=yb(e=>!!i||!1===c.filter()||!e.search||e.filtered.groups.has(s));yv(()=>c.group(s),[]),yk(s,o,[e.value,e.heading,l]);let m=eP.useMemo(()=>({id:s,forceMount:i}),[i]);return eP.createElement(xz.div,{ref:xy(o,t),...a,"cmdk-group":"",role:"presentation",hidden:!u||void 0},n&&eP.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),yw(e,e=>eP.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},eP.createElement(yl.Provider,{value:m},e))))}),ym=eP.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=eP.useRef(null),a=yb(e=>!e.search);return n||a?eP.createElement(xz.div,{ref:xy(i,t),...r,"cmdk-separator":"",role:"separator"}):null}),yp=eP.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=null!=e.value,a=eP.useContext(yo),s=yb(e=>e.search),o=yb(e=>e.selectedItemId),l=eP.useContext(ys);return eP.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),eP.createElement(xz.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:i?e.value:s,onChange:e=>{i||a.setState("search",e.target.value),null==n||n(e.target.value)}})}),yf=eP.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=eP.useRef(null),s=eP.useRef(null),o=yb(e=>e.selectedItemId),l=eP.useContext(ys);return eP.useEffect(()=>{if(s.current&&a.current){let e=s.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),eP.createElement(xz.div,{ref:xy(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:l.listId},yw(e,e=>eP.createElement("div",{ref:xy(s,l.listInnerRef),"cmdk-list-sizer":""},e)))}),yh=eP.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:s,...o}=e;return eP.createElement(vV,{open:n,onOpenChange:r},eP.createElement(vK,{container:s},eP.createElement(vY,{"cmdk-overlay":"",className:i}),eP.createElement(v1,{"aria-label":e.label,"cmdk-dialog":"",className:a},eP.createElement(yd,{ref:t,...o}))))}),yg=Object.assign(yd,{List:yf,Item:yc,Input:yp,Group:yu,Separator:ym,Dialog:yh,Empty:eP.forwardRef((e,t)=>yb(e=>0===e.filtered.count)?eP.createElement(xz.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:eP.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return eP.createElement(xz.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},yw(e,e=>eP.createElement("div",{"aria-hidden":!0},e)))})});function yx(e){let t=eP.useRef(e);return yv(()=>{t.current=e}),t}var yv="u"<typeof window?eP.useEffect:eP.useLayoutEffect;function yy(e){let t=eP.useRef();return void 0===t.current&&(t.current=e()),t}function yb(e){let t=eP.useContext(yo),n=()=>e(t.snapshot());return eP.useSyncExternalStore(t.subscribe,n,n)}function yk(e,t,n,r=[]){let i=eP.useRef(),a=eP.useContext(ys);return yv(()=>{var s;let o=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),l=r.map(e=>e.trim());a.value(e,o,l),null==(s=t.current)||s.setAttribute(yi,o),i.current=o}),i}var yj=()=>{let[e,t]=eP.useState(),n=yy(()=>new Map);return yv(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function yw({asChild:e,children:t},n){let r;return e&&eP.isValidElement(t)?eP.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var yN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.s([],53296),e.i(53296);let y_=eP.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0}),yS=function(e){let t=(0,tj.useBaseUiId)(),n=void 0===e.controlId?t:e.controlId,[r,i]=eP.useState(n),[a,s]=eP.useState(e.labelId),[o,l]=eP.useState([]),d=(0,ts.useRefWithInit)(()=>new Map),{messageIds:c}=re(),u=(0,ti.useStableCallback)((e,t)=>{let n=d.current;void 0===t?n.delete(e):(n.set(e,t),i(e=>{let t;if(0!==n.size){for(let r of n.values()){if(void 0!==e&&r===e)return e;void 0===t&&(t=r)}return t}}))}),m=eP.useCallback(e=>(0,tN.mergeProps)({"aria-describedby":c.concat(o).join(" ")||void 0},e),[c,o]),p=eP.useMemo(()=>({controlId:r,registerControlId:u,labelId:a,setLabelId:s,messageIds:o,setMessageIds:l,getDescriptionProps:m}),[r,u,a,s,o,l,m]);return(0,eT.jsx)(n7.Provider,{value:p,children:e.children})};function y$(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let yI=Object.keys(n1),yE=eP.forwardRef(function(e,t){let{errors:n,validationMode:r,submitAttemptedRef:i}=rp(),{render:a,className:s,validate:o,validationDebounceTime:l=0,validationMode:d=r,name:c,disabled:u=!1,invalid:m,dirty:p,touched:f,actionsRef:h,style:g,...x}=e,{disabled:v}=function(e=!1){let t=eP.useContext(y_);if(!t&&!e)throw Error((0,tm.default)(86));return t}(),y=(0,ti.useStableCallback)(o||(()=>null)),b=v||u,[k,j]=eP.useState(!1),[w,N]=eP.useState(!1),[_,S]=eP.useState(!1),[$,I]=eP.useState(!1),E=p??w,C=f??k,A=eP.useRef(!1),T=eP.useRef(void 0),P=eP.useCallback(()=>T.current,[]),z=eP.useCallback(e=>{T.current=e},[]),O=(0,ti.useStableCallback)(e=>{void 0===p&&(e&&(A.current=!0),N(e))}),M=(0,ti.useStableCallback)(e=>{void 0===f&&j(e)}),R=(0,ti.useStableCallback)(()=>"onChange"===d||"onSubmit"===d&&i.current),D=!!c&&Object.hasOwn(n,c)&&void 0!==n[c],L=!0===m||D,[U,Z]=eP.useState({state:n1,error:"",errors:[],value:null,initialValue:null}),F=!L&&U.state.valid,B=eP.useMemo(()=>({disabled:b,touched:C,dirty:E,valid:F,filled:_,focused:$}),[b,C,E,F,_,$]),V=function(e){let{formRef:t,clearErrors:n}=rp(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:s,invalid:o,markedDirtyRef:l,state:d,name:c,shouldValidateOnChange:u,getRegisteredFieldId:m}=e,{controlId:p,getDescriptionProps:f}=re(),h=(0,nz.useTimeout)(),g=eP.useRef(null),x=(0,ti.useStableCallback)(async(e,n=!1)=>{let s,c=g.current;if(!c)return;function f(e,n=o){let r=m()??p;if(null==r)return;let i=t.current.fields.get(r);if(!i)return;let a=y$(e,n);t.current.fields.set(r,{...i,validityData:a})}if(n){if(!1!==d.valid)return;let t=c.validity;if(!t.valueMissing){let t={value:e,state:{...n1,valid:!0},error:"",errors:[],initialValue:a.initialValue};c.setCustomValidity(""),f(t,!1),r(t);return}let n=yI.reduce((e,n)=>(e[n]=t[n],e),{});if(!n.valid&&!function(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let n of yI)"valid"!==n&&("valueMissing"===n&&(t=e[n]),e[n]&&(t=!1));return t}(n))return}h.clear();let x=null,v=[],y=function(e){let t=yI.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of yI)if("valid"!==e){if("valueMissing"===e&&t[e])n=!0;else if(t[e])return t}return n&&!l.current&&(t.valid=!0,t.valueMissing=!1),t}(c),b=u();if(c.validationMessage&&!b)s=c.validationMessage,v=[c.validationMessage];else{let n=i(e,Array.from(t.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));null!==(x="object"==typeof n&&null!==n&&"then"in n?await n:n)?(y.valid=!1,y.customError=!0,Array.isArray(x)?(v=x,c.setCustomValidity(x.join("\n"))):x&&(v=[x],c.setCustomValidity(x))):b&&(c.setCustomValidity(""),y.customError=!1,c.validationMessage?(s=c.validationMessage,v=[c.validationMessage]):c.validity.valid&&!y.valid&&(y.valid=!0))}let k={value:e,state:y,error:s??(Array.isArray(x)?x[0]:x??""),errors:v,initialValue:a.initialValue};f(k),r(k)}),v=eP.useCallback((e={})=>(0,tN.mergeProps)(f,!1===d.valid?{"aria-invalid":!0}:tU.EMPTY_OBJECT,e),[f,d.valid]),y=eP.useCallback((e={})=>(0,tN.mergeProps)({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(n(c),!u())return void x(e.currentTarget.value,!0);let t=e.currentTarget;""===t.value?x(t.value):(h.clear(),s?h.start(s,()=>{x(t.value)}):x(t.value))}},v(e)),[v,n,c,h,x,s,u]);return eP.useMemo(()=>({getValidationProps:v,getInputValidationProps:y,inputRef:g,commit:x}),[v,y,x])}({setValidityData:Z,validate:y,validityData:U,validationDebounceTime:l,invalid:L,markedDirtyRef:A,state:B,name:c,shouldValidateOnChange:R,getRegisteredFieldId:P}),q=U.value,W=eP.useCallback(()=>{A.current=!0,V.commit(q)},[V,q]),H=function(e){let{commit:t,invalid:n,markedDirtyRef:r,name:i,setRegisteredFieldId:a,setValidityData:s,validityData:o}=e,{formRef:l}=rp(),d=eP.useRef(null),c=eP.useRef(null),u=eP.useRef(null),m=(0,ti.useStableCallback)(()=>{let e=c.current;if(e)return e.getValue?e.getValue():e.value}),p=(0,ti.useStableCallback)(()=>{let e=c.current;if(!e)return;let n=e.value;void 0===n&&(n=m()),r.current=!0,t(n)});function f(e=c.current?.id){e&&l.current.fields.delete(e)}return(0,tr.useIsoLayoutEffect)(()=>{let e=c.current;e&&e.id&&l.current.fields.set(e.id,{getValue:m,name:i,controlRef:e.controlRef??u,validityData:y$(o,n),validate:p})},[l,m,n,i,p,o]),(0,tr.useIsoLayoutEffect)(()=>{let e=l.current.fields;return()=>{let t=c.current?.id;t&&e.delete(t)}},[l]),(0,ti.useStableCallback)((e,t)=>{let r;if(!t){d.current===e&&(d.current=null,f(),c.current=null,a(void 0));return}let h=c.current?.id;d.current=e,c.current=t,a(t.id),h&&h!==t.id&&f(h),function(){let e=c.current;if(!e)return;let t=e.value;void 0===t&&(t=m()),null===o.initialValue&&null!==t&&s(e=>({...e,initialValue:t}))}(),(r=c.current)&&r.id&&l.current.fields.set(r.id,{getValue:m,name:i,controlRef:r.controlRef??u,validityData:y$(o,n),validate:p})})}({commit:V.commit,invalid:L,markedDirtyRef:A,name:c,setRegisteredFieldId:z,setValidityData:Z,validityData:U});eP.useImperativeHandle(h,()=>({validate:W}),[W]);let G=eP.useMemo(()=>({invalid:L,name:c,validityData:U,setValidityData:Z,disabled:b,touched:C,setTouched:M,dirty:E,setDirty:O,filled:_,setFilled:S,focused:$,setFocused:I,validate:y,validationMode:d,validationDebounceTime:l,shouldValidateOnChange:R,state:B,markedDirtyRef:A,registerFieldControl:H,validation:V}),[L,c,U,b,C,M,E,O,_,S,$,I,y,d,l,R,B,H,V]),K=(0,ta.useRenderElement)("div",e,{ref:t,state:B,props:x,stateAttributesMapping:n5});return(0,eT.jsx)(n3.Provider,{value:G,children:K})}),yC=eP.forwardRef(function(e,t){return(0,eT.jsx)(yS,{children:(0,eT.jsx)(yE,{...e,ref:t})})}),yA=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,nativeLabel:s=!0,...o}=e,l=n9(!1),{labelId:d}=re(),c=eP.useRef(null),u=rw({id:d??a,native:s});return(0,ta.useRenderElement)("label",e,{ref:[t,c],state:l.state,props:[u,o],stateAttributesMapping:n5})}),yT={...n5,...tY.transitionStatusMapping},yP=eP.forwardRef(function(e,t){let{render:n,id:r,className:i,match:a,style:s,...o}=e,l=(0,tj.useBaseUiId)(r),{validityData:d,state:c,name:u}=n9(!1),{setMessageIds:m}=re(),{errors:p}=rp(),f=u?p[u]:null,h="string"==typeof a,g=!1;g=!0===a||(h?!!d.state[a]:!!f||!1===d.state.valid);let{mounted:x,transitionStatus:v,setMounted:y}=(0,tQ.useTransitionStatus)(g);(0,tr.useIsoLayoutEffect)(()=>{if(g&&l)return m(e=>e.concat(l)),()=>{m(e=>e.filter(e=>e!==l))}},[g,l,m]);let b=eP.useRef(null),[k,j]=eP.useState(null),[w,N]=eP.useState(null),_=d.errors.length>1?(0,eT.jsx)("ul",{children:d.errors.map(e=>(0,eT.jsx)("li",{children:e},e))}):d.error,S=h?_:f||_,$=d.error;null!=f?$=Array.isArray(f)?JSON.stringify(f):f:d.errors.length>1&&($=JSON.stringify(d.errors)),g&&$!==w&&(N($),j(S)),(0,tX.useOpenChangeComplete)({open:g,ref:b,onComplete(){g||y(!1)}});let I={...c,transitionStatus:v},E=(0,ta.useRenderElement)("div",e,{ref:[t,b],state:I,props:[{id:l,children:g?S:k},o],stateAttributesMapping:yT,enabled:x});return x?E:null}),yz=eP.forwardRef(function(e,t){let{render:n,id:r,className:i,style:a,...s}=e,o=(0,tj.useBaseUiId)(r),l=n9(!1),{setMessageIds:d}=re();return(0,tr.useIsoLayoutEffect)(()=>{if(o)return d(e=>e.concat(o)),()=>{d(e=>e.filter(e=>e!==o))}},[o,d]),(0,ta.useRenderElement)("p",e,{ref:t,state:l.state,props:[{id:o},s],stateAttributesMapping:n5})}),yO=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:s,disabled:o=!1,onValueChange:l,defaultValue:d,autoFocus:c=!1,style:u,...m}=e,{state:p,name:f,disabled:h,setTouched:g,setDirty:x,validityData:v,setFocused:y,setFilled:b,validationMode:k,validation:j}=n9(),w=h||o,N={...p,disabled:w},{labelId:_}=re(),S=rt({id:i});(0,tr.useIsoLayoutEffect)(()=>{let e=null!=s;j.inputRef.current?.value||e&&""!==s?b(!0):e&&""===s&&b(!1)},[j.inputRef,b,s]);let $=eP.useRef(null);(0,tr.useIsoLayoutEffect)(()=>{c&&$.current===(0,tM.activeElement)((0,tk.ownerDocument)($.current))&&y(!0)},[c,y]);let[I]=tn({controlled:s,default:d,name:"FieldControl",state:"value"}),E=void 0!==s,C=E?I:void 0,A=(0,ti.useStableCallback)(()=>j.inputRef.current?.value);return n8(j.inputRef,S,C,A),(0,ta.useRenderElement)("input",e,{ref:[t,$],state:N,props:[{id:S,disabled:w,name:f??a,ref:j.inputRef,"aria-labelledby":_,autoFocus:c,...E?{value:C}:{defaultValue:d},onChange(e){let t=e.currentTarget.value;l?.(t,(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent)),x(t!==v.initialValue),b(""!==t)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),"onBlur"===k&&j.commit(e.currentTarget.value)},onKeyDown(e){"INPUT"===e.currentTarget.tagName&&"Enter"===e.key&&(g(!0),j.commit(e.currentTarget.value))}},j.getInputValidationProps(),m],stateAttributesMapping:n5})}),yM=eP.createContext({disabled:!1}),yR=eP.createContext(void 0),yD=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,...s}=e,{state:o,disabled:l}=n9(!1),d=l||a,c=function(e=!0){let t=eP.useContext(yR);if(void 0===t&&!e)throw Error((0,tm.default)(3));return t}(),u=c?.allValues!==void 0?c?.parent.id:void 0,m=eP.useMemo(()=>({disabled:d}),[d]),p=(0,ta.useRenderElement)("div",e,{ref:t,state:o,props:s,stateAttributesMapping:n5});return(0,eT.jsx)(yS,{controlId:u,children:(0,eT.jsx)(yM.Provider,{value:m,children:p})})});e.s(["Control",0,yO,"Description",0,yz,"Error",0,yP,"Item",0,yD,"Label",0,yA,"Root",0,yC,"Validity",0,function(e){let{children:t}=e,{validityData:n,invalid:r}=n9(!1),i=eP.useMemo(()=>y$(n,r),[n,r]),a=!1===i.state.valid,{transitionStatus:s}=(0,tQ.useTransitionStatus)(a),o=eP.useMemo(()=>({...i,validity:i.state,transitionStatus:s}),[i,s]);return(0,eT.jsx)(eP.Fragment,{children:t(o)})}],56615);var yL=e.i(56615),yL=yL;let yU=eP.forwardRef(function(e,t){return(0,eT.jsx)(yL.Control,{ref:t,...e})});function yZ({className:e,type:t,...n}){return(0,eT.jsx)(yU,{type:t,"data-slot":"input",className:(0,ny.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}function yF({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,ny.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let yB=nv("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function yV({className:e,align:t="inline-start",...n}){return(0,eT.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,ny.cn)(yB({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}function yq({className:e,...t}){return(0,eT.jsx)(yg,{"data-slot":"command",className:(0,ny.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})}function yW({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!1,...a}){return(0,eT.jsxs)(sO,{...a,children:[(0,eT.jsxs)(sU,{className:"sr-only",children:[(0,eT.jsx)(sZ,{children:e}),(0,eT.jsx)(sF,{children:t})]}),(0,eT.jsx)(sL,{className:(0,ny.cn)("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",r),showCloseButton:i,children:n})]})}function yH({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,eT.jsxs)(yF,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,eT.jsx)(yg.Input,{"data-slot":"command-input",className:(0,ny.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,eT.jsx)(yV,{children:(0,eT.jsx)(eX,{className:"size-4 shrink-0 opacity-50"})})]})})}function yG({className:e,...t}){return(0,eT.jsx)(yg.List,{"data-slot":"command-list",className:(0,ny.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}function yK({className:e,...t}){return(0,eT.jsx)(yg.Empty,{"data-slot":"command-empty",className:(0,ny.cn)("py-6 text-center text-sm",e),...t})}function yJ({className:e,...t}){return(0,eT.jsx)(yg.Group,{"data-slot":"command-group",className:(0,ny.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})}function yY({className:e,...t}){return(0,eT.jsx)(yg.Separator,{"data-slot":"command-separator",className:(0,ny.cn)("-mx-1 h-px bg-border",e),...t})}function yX({className:e,children:t,...n}){return(0,eT.jsxs)(yg.Item,{"data-slot":"command-item",className:(0,ny.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...n,children:[t,(0,eT.jsx)(iq,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function yQ({className:e,...t}){return(0,eT.jsx)("span",{"data-slot":"command-shortcut",className:(0,ny.cn)("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",e),...t})}function y0({open:e,onOpenChange:t,tabs:n,onSelectTab:r,onRunChecks:i,report:a,insights:s}){let{resolvedTheme:o,setTheme:l}=(0,sQ.useTheme)(),{viewIssue:d}=l$(),c=(0,eP.useMemo)(()=>{let e=[];return a.lint.messages.forEach((t,n)=>e.push({id:`lint-${n}`,issue:oH(t),group:"Lint",icon:eZ})),a.types.diagnostics.forEach((t,n)=>e.push({id:`type-${n}`,issue:oG(t),group:"Types",icon:eF})),a.security.findings.forEach(t=>e.push({id:`sec-${t.id}`,issue:oK(t),group:"Security",icon:eB})),a.deps.findings.forEach(t=>e.push({id:`dep-${t.id}`,issue:oJ(t),group:"Dependencies",icon:eq})),s.database.findings.forEach(t=>e.push({id:`db-${t.id}`,issue:o0(t),group:"Database",icon:eW})),s.tests.findings.forEach(t=>e.push({id:`test-${t.id}`,issue:o6(t),group:"Tests",icon:e1})),s.performance.findings.forEach(t=>e.push({id:`perf-${t.id}`,issue:o5(t),group:"Performance",icon:e0})),s.accessibility.violations.forEach(t=>e.push({id:`a11y-${t.id}`,issue:o4(t),group:"Accessibility",icon:eQ})),s.env.variables.forEach(t=>e.push({id:`env-${t.key}`,issue:oX(t),group:"Environment",icon:eH})),s.network.calls.forEach(t=>e.push({id:`net-${t.id}`,issue:oQ(t),group:"Network",icon:eG})),s.git.issues.forEach(t=>e.push({id:`git-${t.id}`,issue:o1(t),group:"Git",icon:eK})),s.git.workflows.forEach(t=>t.issues.forEach(t=>e.push({id:`ci-${t.id}`,issue:o1(t),group:"CI/CD",icon:eK}))),e},[a,s]);function u(e){t(!1),setTimeout(e,0)}return(0,eT.jsx)(yW,{open:e,onOpenChange:t,className:"sm:!max-w-xl",children:(0,eT.jsxs)(yq,{children:[(0,eT.jsx)(yH,{placeholder:"Search issues, files, and actions…"}),(0,eT.jsxs)(yG,{children:[(0,eT.jsx)(yK,{children:"No results found."}),(0,eT.jsx)(yJ,{heading:"Go to tab",children:n.map(e=>(0,eT.jsxs)(yX,{value:`tab ${e.label}`,onSelect:()=>u(()=>r(e.value)),children:[(0,eT.jsx)(e.icon,{}),(0,eT.jsx)("span",{children:e.label})]},e.value))}),(0,eT.jsx)(yY,{}),(0,eT.jsxs)(yJ,{heading:"Actions",children:[(0,eT.jsxs)(yX,{value:"run checks analysis",onSelect:()=>u(()=>i?.()),children:[(0,eT.jsx)(i2,{}),(0,eT.jsx)("span",{children:"Run checks"}),(0,eT.jsx)(yQ,{children:"R"})]}),(0,eT.jsxs)(yX,{value:"open settings",onSelect:()=>u(()=>r("settings")),children:[(0,eT.jsx)(e5,{}),(0,eT.jsx)("span",{children:"Open settings"}),(0,eT.jsx)(yQ,{children:","})]}),(0,eT.jsxs)(yX,{value:"toggle theme dark light",onSelect:()=>u(()=>l("dark"===o?"light":"dark")),children:[(0,eT.jsx)(xu,{}),(0,eT.jsx)("span",{children:"Toggle theme"})]})]}),(0,eT.jsx)(yY,{}),(0,eT.jsx)(yJ,{heading:"Issues & findings",children:c.map(e=>{let t=oV(e.issue.severity);return(0,eT.jsxs)(yX,{value:`${e.group} ${e.issue.title} ${e.issue.filePath} ${e.issue.ruleId??""} ${e.issue.code??""}`,onSelect:()=>u(()=>d(e.issue)),children:[(0,eT.jsx)(e.icon,{}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.issue.title}),(0,eT.jsxs)("span",{className:"ml-2 flex shrink-0 items-center gap-2",children:[(0,eT.jsx)(gc,{className:(0,ny.cn)("size-3",t.text)}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.group})]})]},e.id)})})]})]})})}nv("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let y1=eL("scan-search",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);function y2({onRunChecks:e,onLoadDemo:t}){return(0,eT.jsxs)("div",{className:"flex min-h-[60svh] flex-col items-center justify-center px-4 py-16 text-center",children:[(0,eT.jsx)("div",{className:"flex size-14 items-center justify-center rounded-md border border-border bg-card text-muted-foreground",children:(0,eT.jsx)(y1,{className:"size-7"})}),(0,eT.jsx)("h2",{className:"mt-6 text-balance text-lg font-semibold text-foreground",children:"No analysis yet"}),(0,eT.jsx)("p",{className:"mt-2 max-w-md text-pretty text-sm leading-relaxed text-muted-foreground",children:"Run Projectlens against a project to populate every surface with real lint, type, security, dependency, and project-intelligence results."}),(0,eT.jsxs)("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:[(0,eT.jsxs)("button",{type:"button",onClick:e,className:"inline-flex items-center gap-2 rounded-sm bg-primary px-4 py-2 font-mono text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(i2,{className:"size-4"}),"Run checks"]}),(0,eT.jsxs)("button",{type:"button",onClick:t,className:"inline-flex items-center gap-2 rounded-sm border border-border bg-card px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(e1,{className:"size-4"}),"Load demo data"]})]}),(0,eT.jsxs)("div",{className:"mt-8 flex items-center gap-2 rounded-sm border border-border bg-secondary/40 px-3 py-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(e2,{className:"size-3.5 shrink-0"}),(0,eT.jsxs)("span",{children:["Or run ",(0,eT.jsx)("span",{className:"font-semibold text-foreground",children:"Projectlens"})," in your project directory"]})]})]})}function y4({monorepo:e,aggregate:t,selectedPackage:n,onSelect:r}){return(0,eT.jsxs)(iH,{value:n??"__aggregate__",onValueChange:e=>r("__aggregate__"===e?null:e),children:[(0,eT.jsx)(iJ,{className:"w-full",children:(0,eT.jsx)(iK,{placeholder:"All packages"})}),(0,eT.jsxs)(iY,{children:[(0,eT.jsxs)(iQ,{value:"__aggregate__",children:["All packages (",e.packages.length,") — Score: ",t.score]}),t.packageScores.map(e=>(0,eT.jsxs)(iQ,{value:e.name,children:[e.name," — ",e.score," (",e.grade,")"]},e.name))]})]})}function y5({workspace:e,onSelectPackage:t}){return(0,eT.jsxs)("div",{className:"space-y-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("h3",{className:"font-mono text-sm font-medium text-foreground",children:"Packages"}),(0,eT.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[e.monorepo.packages.length," packages · ",e.monorepo.tool]})]}),(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e.aggregate.packageScores.map(n=>{let r=e.packages[n.name];return(0,eT.jsxs)("button",{type:"button",onClick:()=>t(n.name),className:"group flex flex-col items-center gap-2 rounded-xl bg-card p-4 text-left ring-1 ring-foreground/10 transition-colors hover:ring-foreground/25",children:[(0,eT.jsx)(oh,{score:n.score,grade:n.grade,size:64}),(0,eT.jsxs)("div",{className:"text-center",children:[(0,eT.jsx)("p",{className:"font-mono text-xs font-medium text-foreground truncate max-w-[180px]",children:n.name}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[r?.lint.errorCount??0," lint ·"," ",r?.types.diagnostics.length??0," types ·"," ",r?.security.findings.length??0," security"]})]})]},n.name)})})]})}let y6=eL("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),y3=eL("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),y9=eL("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),y8=eL("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),y7=eL("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]),be=eL("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);e.s([],63983),e.i(63983);let bt=eP.createContext(void 0),bn=((k={}).checked="data-checked",k.unchecked="data-unchecked",k.disabled="data-disabled",k.readonly="data-readonly",k.required="data-required",k.valid="data-valid",k.invalid="data-invalid",k.touched="data-touched",k.dirty="data-dirty",k.filled="data-filled",k.focused="data-focused",k),br={...n5,checked:e=>e?{[bn.checked]:""}:{[bn.unchecked]:""}},bi=eP.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:s,id:o,inputRef:l,name:d,nativeButton:c=!1,onCheckedChange:u,readOnly:m=!1,required:p=!1,disabled:f=!1,render:h,uncheckedValue:g,value:x,style:v,...y}=e,{clearErrors:b}=rp(),{state:k,setTouched:j,setDirty:w,validityData:N,setFilled:_,setFocused:S,shouldValidateOnChange:$,validationMode:I,disabled:E,name:C,validation:A}=n9(),{labelId:T}=re(),P=E||f,z=C??d,O=eP.useRef(null),M=(0,tC.useMergedRefs)(O,l,A.inputRef),R=eP.useRef(null),D=(0,tj.useBaseUiId)(),L=rt({id:o,implicit:!1,controlRef:R}),U=c?void 0:L,[Z,F]=tn({controlled:n,default:!!i,name:"Switch",state:"checked"});n8(R,D,Z),(0,tr.useIsoLayoutEffect)(()=>{O.current&&_(O.current.checked)},[O,_]),rf(Z,()=>{b(z),w(Z!==N.initialValue),_(Z),$()?A.commit(Z):A.commit(Z,!0)});let{getButtonProps:B,buttonRef:V}=t$({disabled:P,native:c}),q=function(e,t,n,r=!0,i){let[a,s]=eP.useState(),o=(0,tj.useBaseUiId)(i?`${i}-label`:void 0),l=e??t??a;return(0,tr.useIsoLayoutEffect)(()=>{let i=e||t||!r?void 0:function(e,t){let n=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}(n.current,o);a!==i&&s(i)}),l}(a,T,O,!c,U),W=(0,tN.mergeProps)({checked:Z,disabled:P,form:s,id:U,name:z,required:p,style:z?n$.visuallyHiddenInput:n$.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:M,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m)return void e.preventDefault();let t=e.currentTarget.checked,n=(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent);u?.(t,n),n.isCanceled||F(t)},onFocus(){R.current?.focus()}},A.getInputValidationProps,void 0!==x?{value:x}:tU.EMPTY_OBJECT),H=eP.useMemo(()=>({...k,checked:Z,disabled:P,readOnly:m,required:p}),[k,Z,P,m,p]),G=(0,ta.useRenderElement)("span",e,{state:H,ref:[t,R,V],props:[{id:c?L:D,role:"switch","aria-checked":Z,"aria-readonly":m||void 0,"aria-required":p||void 0,"aria-labelledby":q,onFocus(){P||S(!0)},onBlur(){let e=O.current;e&&!P&&(j(!0),S(!1),"onBlur"===I&&A.commit(e.checked))},onClick(e){if(m||P)return;e.preventDefault();let t=O.current;t&&t.dispatchEvent(new((0,rS.ownerWindow)(t)).PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},A.getValidationProps,y,B],stateAttributesMapping:br});return(0,eT.jsxs)(bt.Provider,{value:H,children:[G,!Z&&z&&void 0!==g&&(0,eT.jsx)("input",{type:"hidden",form:s,name:z,value:g}),(0,eT.jsx)("input",{...W,suppressHydrationWarning:!0})]})}),ba=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,s=function(){let e=eP.useContext(bt);if(void 0===e)throw Error((0,tm.default)(63));return e}();return(0,ta.useRenderElement)("span",e,{state:s,ref:t,stateAttributesMapping:br,props:a})});e.s(["Root",0,bi,"Thumb",0,ba],34344);var bs=e.i(34344),bs=bs;function bo({className:e,size:t="default",...n}){return(0,eT.jsx)(bs.Root,{"data-slot":"switch","data-size":t,className:(0,ny.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:(0,eT.jsx)(bs.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function bl({className:e,...t}){return(0,eT.jsx)("label",{"data-slot":"label",className:(0,ny.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function bd({provider:e,value:t,active:n,onChange:r}){let[i,a]=(0,eP.useState)(!1),s=t.trim().length>0,o=!e.keyPrefix||!s||t.startsWith(e.keyPrefix);return(0,eT.jsxs)("div",{className:(0,ny.cn)("flex flex-col gap-2 border-l-2 py-3 pl-4 transition-colors",n?"border-foreground":"border-border"),children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(bl,{htmlFor:`key-${e.id}`,className:"font-mono text-sm font-medium text-foreground",children:e.name}),n&&(0,eT.jsx)("span",{className:"rounded-sm border border-foreground/30 bg-foreground/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide text-foreground",children:"Active"}),s&&o&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(iq,{className:"size-3"})," set"]})]}),(0,eT.jsx)("code",{className:"font-mono text-[11px] text-muted-foreground",children:e.envVar})]}),(0,eT.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:e.blurb}),e.needsKey?(0,eT.jsx)("div",{className:"flex items-center gap-2",children:(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(yZ,{id:`key-${e.id}`,type:i?"text":"password",value:t,spellCheck:!1,autoComplete:"off",placeholder:e.keyPrefix?`${e.keyPrefix}…`:"Enter API key",onChange:e=>r(e.target.value),className:(0,ny.cn)("rounded-sm pr-9 font-mono text-sm",!o&&"border-destructive/60")}),(0,eT.jsx)("button",{type:"button",onClick:()=>a(e=>!e),"aria-label":i?"Hide key":"Show key",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground",children:i?(0,eT.jsx)(cy,{className:"size-4"}):(0,eT.jsx)(cv,{className:"size-4"})})]})}):(0,eT.jsx)(yZ,{id:`key-${e.id}`,value:t,spellCheck:!1,placeholder:"http://localhost:11434",onChange:e=>r(e.target.value),className:"rounded-sm font-mono text-sm"}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[o?(0,eT.jsx)("span",{}):(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-destructive",children:["Expected a key starting with ",e.keyPrefix]}),e.keyUrl&&(0,eT.jsxs)("a",{href:e.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:["Get key ",(0,eT.jsx)(oE,{className:"size-3"})]})]})]})}let bc=eL("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),bu=eL("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),bm=new Set(["openrouter/meta-llama/llama-3.2-90b","openrouter/meta-llama/llama-3.2-1b","openrouter/meta-llama/llama-3.1-405b-instruct","openrouter/meta-llama/llama-3-8b-instruct","openrouter/meta-llama/llama-2-13b","openrouter/openchat/openchat-3.5","openrouter/undi95/toppy-m-7b","openrouter/gryphe/mythomax-l2-13b","openrouter/cinematika/cinematika-7b"]);async function bp(){let e=await fetch("https://models.dev/api.json",{headers:{accept:"application/json"}});if(!e.ok)throw Error(`models.dev responded ${e.status}`);var t=await e.json();let n=[];for(let[e,r]of Object.entries(t)){let t=r?.name??e;for(let[i,a]of Object.entries(r?.models??{})){let r=`${e}/${i}`;n.push({id:r,modelId:i,name:a.name??i,providerId:e,providerName:t,family:a.family,reasoning:!!a.reasoning,toolCall:!!a.tool_call,attachment:!!a.attachment,openWeights:!!a.open_weights,inputModalities:a.modalities?.input??[],outputModalities:a.modalities?.output??[],contextLimit:a.limit?.context,outputLimit:a.limit?.output,knowledge:a.knowledge,releaseDate:a.release_date,lastUpdated:a.last_updated,freeOpenRouter:bm.has(r)||"openrouter"===e&&a.cost?.input===0,cost:a.cost?{input:a.cost.input,output:a.cost.output,cacheRead:a.cost.cache_read,cacheWrite:a.cost.cache_write}:void 0})}}return n.sort((e,t)=>{let n=e.releaseDate??"",r=t.releaseDate??"";return n!==r?r.localeCompare(n):e.name.localeCompare(t.name)}),n}let bf=[{id:"all",label:"All"},{id:"reasoning",label:"Reasoning"},{id:"toolCall",label:"Tools"},{id:"attachment",label:"Multimodal"},{id:"openWeights",label:"Open weights"}];function bh(e){return null==e?null:0===e?"$0":`$${e<1?e.toFixed(2):e.toFixed(2).replace(/\.00$/,"")}`}function bg({icon:e,label:t}){return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(e,{className:"size-3"}),t]})}function bx({model:e,selected:t,onSelect:n}){var r;let i=(r=e.contextLimit)?r>=1e6?`${(r/1e6).toFixed(+(r%1e6!=0))}M`:r>=1e3?`${Math.round(r/1e3)}K`:String(r):null,a=bh(e.cost?.input),s=bh(e.cost?.output);return(0,eT.jsxs)("button",{type:"button",onClick:n,className:(0,ny.cn)("flex w-full flex-col gap-2 rounded-sm border p-3 text-left transition-colors",t?"border-primary/50 bg-primary/[0.06]":"border-border bg-card hover:border-foreground/20 hover:bg-secondary/40"),children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.name}),t&&(0,eT.jsx)(iq,{className:"size-3.5 shrink-0 text-primary"})]}),(0,eT.jsx)("p",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:e.id})]}),(0,eT.jsx)("span",{className:"shrink-0 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.providerName})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.reasoning&&(0,eT.jsx)(bg,{icon:bc,label:"reasoning"}),e.toolCall&&(0,eT.jsx)(bg,{icon:s4,label:"tools"}),e.attachment&&(0,eT.jsx)(bg,{icon:bu,label:"multimodal"}),e.openWeights&&(0,eT.jsx)(bg,{icon:dD,label:"open"})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[10px] text-muted-foreground",children:[i&&(0,eT.jsxs)("span",{children:[i," ctx"]}),a&&(0,eT.jsxs)("span",{children:["in ",a,(0,eT.jsx)("span",{className:"text-muted-foreground/60",children:"/1M"})]}),s&&(0,eT.jsxs)("span",{children:["out ",s,(0,eT.jsx)("span",{className:"text-muted-foreground/60",children:"/1M"})]}),e.releaseDate&&(0,eT.jsx)("span",{children:e.releaseDate})]})]})}function bv({value:e,onChange:t,children:n,triggerClassName:r}){let[i,a]=(0,eP.useState)(!1),[s,o]=(0,eP.useState)(""),[l,d]=(0,eP.useState)("all"),{data:c,isLoading:u,error:m}=u_(i?"models.dev/catalog":null,bp,{revalidateOnFocus:!1,dedupingInterval:6e5,shouldRetryOnError:!1}),p=(0,eP.useMemo)(()=>c??[],[c]),f=(0,eP.useMemo)(()=>p.find(t=>t.id===e),[p,e]),h=(0,eP.useMemo)(()=>{let e=s.trim().toLowerCase();return p.filter(t=>("reasoning"!==l||!!t.reasoning)&&("toolCall"!==l||!!t.toolCall)&&("attachment"!==l||!!t.attachment)&&("openWeights"!==l||!!t.openWeights)&&(!e||t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.providerName.toLowerCase().includes(e)||(t.family?.toLowerCase().includes(e)??!1)))},[p,s,l]),g=(0,eP.useMemo)(()=>h.filter(e=>e.freeOpenRouter),[h]),x=(0,eP.useMemo)(()=>h.filter(e=>!e.freeOpenRouter),[h]);return(0,eT.jsxs)(sO,{open:i,onOpenChange:a,children:[n?(0,eT.jsx)(sM,{className:r,children:n}):(0,eT.jsxs)(sM,{className:"flex w-full items-center justify-between gap-2 rounded-sm border border-border bg-card px-3 py-2 text-left font-mono text-sm transition-colors hover:border-foreground/20",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e||"Select a model"}),(0,eT.jsx)(eX,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),(0,eT.jsxs)(sL,{className:"flex max-h-[80vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[(0,eT.jsxs)(sU,{className:"border-b border-border px-4 py-3",children:[(0,eT.jsxs)(sZ,{className:"flex items-center gap-2 font-mono text-sm",children:[(0,eT.jsx)(e4,{className:"size-4"}),"Choose a model"]}),(0,eT.jsx)(sF,{className:"text-xs",children:"Live catalog from models.dev — search by name, provider, or capability."})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border px-4 py-3",children:[(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{autoFocus:!0,value:s,onChange:e=>o(e.target.value),placeholder:"Search models…",className:"w-full rounded-sm border border-border bg-background py-2 pl-9 pr-8 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),s&&(0,eT.jsx)("button",{type:"button",onClick:()=>o(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:bf.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>d(e.id),className:(0,ny.cn)("rounded-sm border px-2 py-1 font-mono text-[11px] transition-colors",l===e.id?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:e.label},e.id))})]}),(0,eT.jsx)("div",{className:"min-h-0 flex-1 overflow-auto p-3",children:u?(0,eT.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 font-mono text-sm text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"}),"Loading catalog…"]}):m?(0,eT.jsx)("div",{className:"py-12 text-center font-mono text-sm text-muted-foreground",children:"Could not load the model catalog. Try again shortly."}):0===h.length?(0,eT.jsxs)("div",{className:"py-12 text-center font-mono text-sm text-muted-foreground",children:['No models match "',s,'".']}):(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[g.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-[color:var(--sev-ok)]",children:"Free on OpenRouter"}),(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 font-mono text-[10px] text-[color:var(--sev-ok)]",children:g.length})]}),(0,eT.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:g.map(n=>(0,eT.jsx)(bx,{model:n,selected:n.id===e,onSelect:()=>{t(n.id),a(!1)}},n.id))})]}),x.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[g.length>0&&(0,eT.jsx)("div",{className:"border-t border-border/50"}),(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"All models"}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:x.length})]}),(0,eT.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:x.map(n=>(0,eT.jsx)(bx,{model:n,selected:n.id===e,onSelect:()=>{t(n.id),a(!1)}},n.id))})]})]})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-border px-4 py-2.5 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{children:[h.length," models ",g.length>0&&`(${g.length} free)`]}),f&&(0,eT.jsxs)("span",{className:"truncate text-foreground",children:[f.name," selected"]})]})]})]})}async function by(e="all"){try{return(await fetch(`/api/data?scope=${e}`,{method:"DELETE"})).ok}catch{return!1}}async function bb(){await by("all"),function(){let e=[];for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);n?.startsWith("projectlens.")&&e.push(n)}for(let t of e)window.localStorage.removeItem(t)}()}async function bk(){let e=await fetch("https://ai-gateway.vercel.sh/v1/models",{headers:{accept:"application/json"}});if(!e.ok)throw Error(`Gateway responded ${e.status}`);return((await e.json()).data??[]).filter(e=>"language"===e.type).map(e=>{let t=e.context_window?`${Math.round(e.context_window/1e3)}k ctx`:void 0,n=[e.owned_by,t].filter(Boolean).join(" · ")||void 0;return{id:e.id,label:e.name?.trim()||e.id,note:n}}).sort((e,t)=>e.label.localeCompare(t.label))}function bj({icon:e,title:t,desc:n,children:r}){return(0,eT.jsxs)("section",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[(0,eT.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e,{className:"size-4"})}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground",children:t}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:n})]})]}),(0,eT.jsx)("div",{className:"px-5 py-4",children:r})]})}function bw(){let[e,t]=(0,eP.useState)(gk),[n,r]=(0,eP.useState)(!1),[i,a]=(0,eP.useState)(!1);(0,eP.useEffect)(()=>{t(gN()),a(!0)},[]);let s=gb(e.provider),o="vercel"===e.provider,{data:l,isLoading:d,mutate:c}=u_(o?"gateway/models":null,bk,{revalidateOnFocus:!1,shouldRetryOnError:!1}),u=o&&l?.length?l:s.models;function m(e){t(t=>({...t,...e})),r(!1)}function p(){t(gk),g_(gk),gw(gk.colorAccents),r(!1)}let f=(0,eP.useMemo)(()=>{let t,n,r;return JSON.stringify((t=gb(e.provider),n={},r=e.keys[e.provider],t.needsKey&&r&&(n[t.envVar]=r),e.githubToken.trim()&&(n.GITHUB_TOKEN=e.githubToken.trim()),{ai:{enabled:e.aiEnabled,provider:e.provider,model:e.model,fallbackModel:"google/gemini-2.5-flash",maxFiles:e.maxFiles,redactSecrets:e.redactSecrets},chat:{enabled:e.chatEnabled,persist:e.persistChats,model:e.model},github:{...e.defaultRepo.trim()?{defaultRepo:e.defaultRepo.trim()}:{}},env:n}),null,2)},[e]),h=s.needsKey&&!e.keys[e.provider]?.trim();return i?(0,eT.jsxs)("div",{className:"flex flex-col gap-6 lg:flex-row",children:[(0,eT.jsxs)("div",{className:"flex flex-1 flex-col gap-6",children:[(0,eT.jsx)(bj,{icon:eV,title:"AI security audit",desc:"Choose whether to run the AI review and how it handles your source.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Enable AI security audit",hint:"When off, Projectlens runs lint, types, and the dependency audit only.",checked:e.aiEnabled,onChange:e=>m({aiEnabled:e})}),(0,eT.jsx)(bN,{label:"Redact secrets before sending",hint:"Strip obvious API keys and tokens from snippets before they reach the model.",checked:e.redactSecrets,onChange:e=>m({redactSecrets:e})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Max files per run"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Caps how many source files are sent for review."})]}),(0,eT.jsxs)(iH,{value:String(e.maxFiles),onValueChange:e=>m({maxFiles:Number(e)}),children:[(0,eT.jsx)(iJ,{className:"w-24 rounded-sm font-mono",children:(0,eT.jsx)(iK,{})}),(0,eT.jsx)(iY,{children:[10,25,50,100].map(e=>(0,eT.jsx)(iQ,{value:String(e),children:e},e))})]})]})]})}),(0,eT.jsx)(bj,{icon:s3,title:"Provider & model",desc:"The provider and model used to perform the security review.",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Provider"}),(0,eT.jsxs)(iH,{value:e.provider,onValueChange:n=>{let i,a;return a=(i=gb(n)).models.some(t=>t.id===e.model),void(t(e=>({...e,provider:n,model:a?e.model:i.models[0].id})),r(!1))},children:[(0,eT.jsx)(iJ,{className:"w-full rounded-sm font-mono",children:(0,eT.jsx)(iK,{})}),(0,eT.jsx)(iY,{children:gy.map(e=>(0,eT.jsx)(iQ,{value:e.id,children:e.name},e.id))})]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Model"}),o&&(0,eT.jsxs)("button",{type:"button",onClick:()=>c(),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[d?(0,eT.jsx)(dj,{className:"size-3 animate-spin"}):(0,eT.jsx)(y9,{className:"size-3"}),d?"loading":`${u.length} live`]})]}),(0,eT.jsx)(bv,{value:e.model,onChange:e=>m({model:e})}),(0,eT.jsxs)(iH,{value:e.model??void 0,onValueChange:e=>m({model:e??""}),children:[(0,eT.jsx)(iJ,{className:"w-full rounded-sm font-mono text-xs",children:(0,eT.jsx)(iK,{placeholder:"Quick pick…"})}),(0,eT.jsx)(iY,{className:"max-h-72",children:u.map(e=>(0,eT.jsx)(iQ,{value:e.id,children:e.label},e.id))})]})]})]}),o&&(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:d?"Fetching the live model list from the AI Gateway…":l?.length?"Live text models from the Vercel AI Gateway.":"Showing built-in defaults — could not reach the gateway."}),u.find(t=>t.id===e.model)?.note&&(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:u.find(t=>t.id===e.model)?.note})]})}),(0,eT.jsx)(bj,{icon:eH,title:"API key",desc:"Stored locally in your browser and written to .projectlens.json for the CLI. Never sent anywhere else.",children:s.needsKey?(0,eT.jsx)(bd,{provider:s,value:e.keys[s.id]??"",active:!0,onChange:e=>{var n;return n=s.id,void(t(t=>({...t,keys:{...t.keys,[n]:e}})),r(!1))}},s.id):(0,eT.jsxs)("p",{className:"font-mono text-xs leading-relaxed text-muted-foreground",children:[s.name," runs locally and needs no API key. Make sure the Ollama server is running and reachable at ",(0,eT.jsx)("span",{className:"text-foreground",children:s.envVar}),"."]})}),(0,eT.jsx)(bj,{icon:e6,title:"AI chat assistant",desc:"The in-dashboard assistant available from the sidebar and every issue's “Ask AI” button.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Enable AI chat assistant",hint:"Adds the AI Chat tab and the Ask AI shortcut in issue detail sheets.",checked:e.chatEnabled,onChange:e=>m({chatEnabled:e})}),(0,eT.jsx)(bN,{label:"Persist chat history",hint:"Save conversations to .projectlens/chats.json so they survive restarts. When off, chats are kept in memory only.",checked:e.persistChats,onChange:e=>m({persistChats:e})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Assistant model"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Shared with the audit — set under Provider & model above."})]}),(0,eT.jsx)("span",{className:"max-w-[12rem] truncate rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] text-foreground",children:e.model})]})]})}),(0,eT.jsx)(bj,{icon:eK,title:"GitHub integration",desc:"Powers the enriched Git overview and the Releases dashboard. All fields are optional.",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Access token"}),(0,eT.jsx)("input",{type:"password",value:e.githubToken,onChange:e=>m({githubToken:e.target.value}),placeholder:"ghp_… (optional)",autoComplete:"off",spellCheck:!1,className:"w-full rounded-sm border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),(0,eT.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:["Raises the GitHub API rate limit from 60 to 5,000 requests/hour and enables private repositories. Written to ",(0,eT.jsx)("span",{className:"text-foreground",children:"GITHUB_TOKEN"})," for the CLI."]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Default repository"}),(0,eT.jsx)("input",{type:"text",value:e.defaultRepo,onChange:e=>m({defaultRepo:e.target.value}),placeholder:"owner/repo (optional)",autoComplete:"off",spellCheck:!1,className:"w-full rounded-sm border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),(0,eT.jsx)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:"Overrides the auto-detected remote in the Git & Releases tabs."})]})]})}),(0,eT.jsx)(bj,{icon:be,title:"Appearance",desc:"Tune how the dashboard looks. These preferences are display-only and never affect the CLI config.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Color accents",hint:"Layer subtle semantic colors over the monochrome theme — severity tags, charts, hovers, and focus rings. Takes effect immediately.",checked:e.colorAccents,onChange:function(n){gw(n);let r={...e,colorAccents:n};t(r),g_(r)}}),(0,eT.jsx)(bS,{enabled:e.colorAccents})]})}),(0,eT.jsx)(bj,{icon:e7,title:"Task board",desc:"Your remediation worklist is stored locally in this browser — it never leaves your machine or reaches the CLI.",children:(0,eT.jsx)(b_,{})}),(0,eT.jsx)(bj,{icon:y7,title:"Data & storage",desc:"Reset preferences or permanently delete stored data — runs, chats, the task board, and cached settings.",children:(0,eT.jsx)(bI,{onResetSettings:p})})]}),(0,eT.jsx)("aside",{className:"flex w-full flex-col gap-4 lg:w-80 lg:shrink-0",children:(0,eT.jsxs)("div",{className:"lg:sticky lg:top-6 flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(y6,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xs font-semibold text-foreground",children:".projectlens.json"})]}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"preview"})]}),(0,eT.jsx)("pre",{className:"max-h-80 overflow-auto px-4 py-3 font-mono text-[11px] leading-relaxed text-foreground/80",children:(0,eT.jsx)("code",{children:f})})]}),h&&(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-muted/40 px-4 py-3",children:[(0,eT.jsxs)("p",{className:"font-mono text-xs text-foreground",children:["No key for ",s.name]}),(0,eT.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Add a key above or the AI audit will be skipped at run time."})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsxs)("button",{type:"button",onClick:function(){g_(e),r(!0),window.setTimeout(()=>r(!1),2e3)},className:(0,ny.cn)("inline-flex flex-1 items-center justify-center gap-2 rounded-sm px-4 py-2.5 font-mono text-sm font-medium transition-colors",n?"bg-foreground/10 text-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"),children:[n?(0,eT.jsx)(iq,{className:"size-4"}):(0,eT.jsx)(y3,{className:"size-4"}),n?"Saved":"Save settings"]}),(0,eT.jsx)("button",{type:"button",onClick:p,"aria-label":"Reset to defaults",className:"inline-flex items-center justify-center gap-2 rounded-sm border border-border px-3 py-2.5 font-mono text-sm text-muted-foreground transition-colors hover:text-foreground",children:(0,eT.jsx)(dk,{className:"size-4"})})]})]})})]}):(0,eT.jsx)("div",{className:"h-64 animate-pulse rounded-sm border border-border bg-card/50"})}function bN({label:e,hint:t,checked:n,onChange:r}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:e}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:t})]}),(0,eT.jsx)(bo,{checked:n,onCheckedChange:r})]})}function b_(){let e=lN(lm),t=lu(),n=lN(lk),[r,i]=(0,eP.useState)(null),a=new Set(t.filter(e=>e.done).map(e=>e.id)),s=e.filter(e=>a.has(e.columnId)).length,o=[{label:"Tasks",value:e.length},{label:"Completed",value:s},{label:"Columns",value:t.length},{label:"Groups",value:n.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:o.map(e=>(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-background px-3 py-2.5",children:[(0,eT.jsx)("p",{className:"font-mono text-lg tabular-nums text-foreground",children:e.value}),(0,eT.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:e.label})]},e.label))}),(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Clear completed tasks"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Remove every task in a column marked as done."})]}),(0,eT.jsxs)("button",{type:"button",onClick:lb,disabled:0===s,className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:[(0,eT.jsx)(y8,{className:"size-3.5"}),"Clear ",s>0?s:""]})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Delete all tasks"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Empty the board. Your columns and groups are kept."})]}),"clear"===r?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>{lp([]),i(null)},className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i(null),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>i("clear"),disabled:0===e.length,className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete all"]})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Reset board to defaults"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Restore the default columns and groups and remove all tasks."})]}),"reset"===r?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>{window.localStorage.setItem(lr,JSON.stringify([])),window.localStorage.setItem(la,JSON.stringify(lt)),window.localStorage.setItem(ls,JSON.stringify(ln)),window.localStorage.removeItem(li),window.dispatchEvent(new CustomEvent(lo)),i(null)},className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i(null),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>i("reset"),className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-destructive/40 px-2.5 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",children:[(0,eT.jsx)(dk,{className:"size-3.5"}),"Reset"]})]})]})]})}function bS({enabled:e}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-3 py-3",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:"Preview"}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:e?"Color accents on":"Monochrome"})]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:[{key:"critical",label:"Critical"},{key:"high",label:"High"},{key:"medium",label:"Medium"},{key:"low",label:"Low"},{key:"info",label:"Info"},{key:"ok",label:"Passed"}].map(e=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-sm px-2 py-1 font-mono text-[11px]",style:{backgroundColor:`color-mix(in oklab, var(--sev-${e.key}) 14%, transparent)`,color:`var(--sev-${e.key})`},children:[(0,eT.jsx)("span",{className:"size-1.5 rounded-full",style:{backgroundColor:`var(--sev-${e.key})`}}),e.label]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("span",{className:"inline-flex items-center rounded-sm bg-primary px-2.5 py-1 font-mono text-[11px] text-primary-foreground",children:"Primary"}),(0,eT.jsx)("span",{className:"rounded-sm bg-accent px-2.5 py-1 font-mono text-[11px] text-accent-foreground",children:"Hover"}),(0,eT.jsx)("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(e=>(0,eT.jsx)("span",{className:"size-3 rounded-full",style:{backgroundColor:`var(--chart-${e})`}},e))})]})]})}function b$({icon:e,title:t,desc:n,actionLabel:r,busyLabel:i,onConfirm:a,tone:s="muted"}){let[o,l]=(0,eP.useState)(!1),[d,c]=(0,eP.useState)(!1);async function u(){c(!0);try{await a()}finally{c(!1),l(!1)}}return(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:t}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:n})]}),d?(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"}),i]}):o?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:u,className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>l(!1),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>l(!0),className:(0,ny.cn)("inline-flex shrink-0 items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors","destructive"===s?"border-destructive/40 text-destructive hover:bg-destructive/10":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e,{className:"size-3.5"}),r]})]})}function bI({onResetSettings:e}){return(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(b$,{icon:dk,title:"Reset settings to defaults",desc:"Restore the provider, model, AI, GitHub, and chat preferences to their defaults. Stored data is kept.",actionLabel:"Reset",busyLabel:"Resetting",onConfirm:e}),(0,eT.jsx)(b$,{icon:lW,title:"Delete run history",desc:"Remove all saved runs, the latest snapshot, and project insights from .projectlens/ on this machine.",actionLabel:"Delete runs",busyLabel:"Deleting",tone:"destructive",onConfirm:async()=>{await by("runs"),window.location.reload()}}),(0,eT.jsx)(b$,{icon:e6,title:"Delete chat history",desc:"Erase every saved Ask-AI conversation from .projectlens/chats.json.",actionLabel:"Delete chats",busyLabel:"Deleting",tone:"destructive",onConfirm:async()=>{await by("chats"),window.location.reload()}}),(0,eT.jsx)(b$,{icon:l1,title:"Delete everything",desc:"Wipe all runs, chats, the task board, and cached settings — server data and this browser's storage. This cannot be undone.",actionLabel:"Delete all data",busyLabel:"Wiping",tone:"destructive",onConfirm:async()=>{await bb(),window.location.reload()}})]})}var bE=e.i(57047),bC="vercel.ai.error",bA=Symbol.for(bC),bT=class e extends(A=Error,C=bA,A){constructor({name:e,message:t,cause:n}){super(t),this[C]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,bC)}static hasMarker(e,t){let n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}},bP="AI_APICallError",bz=`vercel.ai.error.${bP}`,bO=Symbol.for(bz),bM=class extends(P=bT,T=bO,P){constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:s,isRetryable:o=null!=r&&(408===r||409===r||429===r||r>=500),data:l}){super({name:bP,message:e,cause:s}),this[T]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=o,this.data=l}static isInstance(e){return bT.hasMarker(e,bz)}},bR="AI_EmptyResponseBodyError",bD=`vercel.ai.error.${bR}`,bL=Symbol.for(bD),bU=class extends(O=bT,z=bL,O){constructor({message:e="Empty response body"}={}){super({name:bR,message:e}),this[z]=!0}static isInstance(e){return bT.hasMarker(e,bD)}};function bZ(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var bF="AI_InvalidArgumentError",bB=`vercel.ai.error.${bF}`,bV=Symbol.for(bB),bq=class extends(R=bT,M=bV,R){constructor({message:e,cause:t,argument:n}){super({name:bF,message:e,cause:t}),this[M]=!0,this.argument=n}static isInstance(e){return bT.hasMarker(e,bB)}},bW=Symbol.for("vercel.ai.error.AI_InvalidPromptError");Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var bH="AI_JSONParseError",bG=`vercel.ai.error.${bH}`,bK=Symbol.for(bG),bJ=class extends(L=bT,D=bK,L){constructor({text:e,cause:t}){super({name:bH,message:`JSON parsing failed: Text: ${e}.
316
+ ${a.snippet.code}`:""].filter(Boolean).join("\n"),{source:a.source,title:a.title,summary:e,filePath:a.filePath,line:a.line,severity:a.severity}))},className:"inline-flex items-center gap-1.5 rounded-sm bg-primary px-2.5 py-1.5 font-mono text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(e4,{className:"size-3.5"}),"Ask AI"]}),(0,eT.jsx)(lO,{issue:a}),a.fixable&&(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-2 py-1 font-mono text-[11px] text-[color:var(--sev-ok)]",children:"auto-fixable"})]}),a.dep&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eq,children:"Package"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:a.dep.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.dep.type})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"installed",value:a.dep.current}),a.dep.latest&&(0,eT.jsx)(lP,{label:"latest",value:a.dep.latest}),a.dep.fixedIn&&(0,eT.jsx)(lP,{label:"fixed in",value:a.dep.fixedIn,highlight:!0}),a.dep.license&&(0,eT.jsx)(lP,{label:"license",value:a.dep.license})]}),a.dep.fixedIn&&"—"!==a.dep.current&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-t border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:a.dep.current}),(0,eT.jsx)(oz,{className:"size-3 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-[color:var(--sev-ok)]",children:a.dep.fixedIn}),(0,eT.jsx)("span",{className:"ml-auto text-muted-foreground",children:"recommended upgrade"})]})]}),a.dep.usedIn&&a.dep.usedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"imported in:"}),a.dep.usedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]})]}),a.env&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eH,children:"Variable"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:a.env.key}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.env.scope})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs",children:[(0,eT.jsx)(lP,{label:"status",value:a.env.status,highlight:"exposed"===a.env.status}),(0,eT.jsx)(lP,{label:"value",value:a.env.sample??"—"})]})]}),a.env.definedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"declared in:"}),a.env.definedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]}),a.env.usedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"referenced in:"}),a.env.usedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]})]}),a.net&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eG,children:"Request"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 uppercase text-foreground",children:a.net.method}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:a.net.url})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"host",value:a.net.host}),(0,eT.jsx)(lP,{label:"client",value:a.net.client}),(0,eT.jsx)(lP,{label:"scheme",value:a.net.secure?"https":"http",highlight:!a.net.secure}),(0,eT.jsx)(lP,{label:"scope",value:a.net.external?"external":"internal"})]})]}),a.net.issues.length>0&&(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:a.net.issues.map((e,t)=>{let n=oV(e.severity);return(0,eT.jsxs)("li",{className:"flex items-start gap-2 text-xs leading-relaxed text-muted-foreground",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-1.5 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("span",{children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-foreground",children:e.kind})," — ",e.message]})]},t)})})]}),a.a11y&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eQ,children:"WCAG details"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-foreground",children:a.a11y.rule}),(0,eT.jsx)("span",{className:"truncate text-muted-foreground",children:a.a11y.selector})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"impact",value:a.a11y.impact,highlight:"critical"===a.a11y.impact}),(0,eT.jsx)(lP,{label:"principle",value:a.a11y.principle}),(0,eT.jsx)(lP,{label:"nodes",value:String(a.a11y.nodes)}),(0,eT.jsx)(lP,{label:"criteria",value:a.a11y.wcag.filter(e=>/^\d/.test(e))[0]??"—"})]})]})]}),a.cves&&a.cves.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eB,children:"Known advisories"}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.cves.map(e=>(0,eT.jsxs)("a",{href:`https://nvd.nist.gov/vuln/detail/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-sm border border-border bg-card px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[e,(0,eT.jsx)(oE,{className:"size-3 text-muted-foreground"})]},e))})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eY,children:"What's happening"}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:a.description})]}),a.snippet&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)(lT,{icon:si,children:"Code"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>d(a.filePath,a.line,a.column),className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:["view full file ",(0,eT.jsx)(a4,{className:"size-3"})]})]}),(0,eT.jsx)(lC,{startLine:a.snippet.startLine,code:a.snippet.code,highlight:a.line})]}),a.related&&a.related.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oT,children:"Diagnostic chain"}),(0,eT.jsx)("ol",{className:"relative ml-2 border-l border-border",children:a.related.map((e,t)=>(0,eT.jsxs)("li",{className:"relative py-1.5 text-sm leading-relaxed text-muted-foreground",style:{paddingLeft:`${12*e.depth+20}px`},children:[(0,eT.jsx)("span",{className:"absolute top-3 size-1.5 rounded-full bg-muted-foreground/40",style:{left:`${12*e.depth+4}px`},"aria-hidden":!0}),e.message]},t))})]}),a.recommendation&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"How to fix"}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card p-3",children:(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:a.recommendation})})]}),a.suggestedFix&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"Suggested fix"}),(0,eT.jsx)(lA,{fix:a.suggestedFix})]}),"lint"===a.source&&a.fixable&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"Auto-fix command"}),(0,eT.jsxs)("code",{className:"rounded-sm border border-border bg-background/60 px-3 py-2 font-mono text-xs text-foreground",children:["eslint --fix ",a.filePath]})]}),f.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eY,children:"Resources & docs"}),(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:f.map(e=>(0,eT.jsx)("li",{children:(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-sm border border-border bg-card px-3 py-2 text-sm transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.label}),(0,eT.jsx)(oE,{className:"size-3.5 shrink-0 text-muted-foreground"})]})},e.href))})]})]})]})})})]})}function lO({issue:e}){let t=lN(lk),n=l_().has(lh(e)),[r,i]=(0,eP.useState)(!1),[a,s]=(0,eP.useState)(null),[o,l]=(0,eP.useState)(!1),[d,c]=(0,eP.useState)("");function u(){l(!1),c("")}function m(t){let n,r,{created:a}=(n=lh(e),(r=lm().find(e=>lg(e)===n))?(t&&r.groupId!==t&&lx(r.id,{groupId:t}),{task:r,created:!1}):{task:lf({title:e.title,source:e.source,severity:e.severity,filePath:e.filePath,line:e.line,groupId:t,priority:function(e){switch(e){case"critical":case"high":case"error":return"high";case"medium":case"warning":return"medium";default:return"low"}}(e.severity),note:e.recommendation,issue:e}),created:!0});s(a?"added":"exists"),window.setTimeout(()=>s(null),1600),i(!1),u()}function p(){let e=d.trim();e&&m(lw(e).id)}let f=a||n?ox:e7;return(0,eT.jsxs)(a5,{open:r,onOpenChange:e=>{i(e),e||u()},children:[(0,eT.jsxs)(a6,{className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors",n?"border-foreground/40 bg-secondary text-foreground":"border-border bg-card text-foreground hover:bg-secondary"),children:[(0,eT.jsx)(f,{className:(0,ny.cn)("size-3.5",n?"text-foreground":"text-muted-foreground")}),"added"===a?"Tracked":"exists"===a?"Already tracked":n?"Tracked":"Track task",(0,eT.jsx)(a4,{className:"size-3 rotate-90 text-muted-foreground"})]}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-52",children:[(0,eT.jsx)("p",{className:"px-1.5 py-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:n?"Update task group":"Add to task board"}),(0,eT.jsxs)(a8,{onClick:()=>m(void 0),children:[(0,eT.jsx)(e7,{className:"size-3.5 text-muted-foreground"}),"Track (no group)"]}),t.length>0&&(0,eT.jsx)(a7,{}),t.map(e=>(0,eT.jsxs)(a8,{onClick:()=>m(e.id),children:[(0,eT.jsx)("span",{className:"size-2 rounded-full border border-muted-foreground","aria-hidden":!0}),e.name]},e.id)),(0,eT.jsx)(a7,{}),o?(0,eT.jsxs)("div",{className:"flex items-center gap-1.5 px-1.5 py-1",onKeyDown:e=>e.stopPropagation(),children:[(0,eT.jsx)("input",{autoFocus:!0,value:d,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p())},placeholder:"New group name",className:"w-full rounded-sm border border-border bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"button",onClick:p,disabled:!d.trim(),className:"rounded-sm bg-primary px-2 py-1 font-mono text-[11px] text-primary-foreground disabled:opacity-40",children:"Add"})]}):(0,eT.jsxs)(a8,{closeOnClick:!1,onClick:()=>l(!0),children:[(0,eT.jsx)(oO,{className:"size-3.5 text-muted-foreground"}),"New group…"]})]})]})}function lM({issue:e,variant:t="badge",className:n}){return l_().has(lh(e))?"dot"===t?(0,eT.jsx)(ox,{className:(0,ny.cn)("size-3.5 shrink-0 text-foreground",n),"aria-label":"Tracked in Task Manager"}):(0,eT.jsxs)("span",{title:"Tracked in Task Manager",className:(0,ny.cn)("inline-flex items-center gap-1 rounded-sm border border-foreground/40 bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground",n),children:[(0,eT.jsx)(ox,{className:"size-3"}),"tracked"]}):null}function lR({path:e,line:t,column:n,className:r,children:i}){let{viewFile:a}=l$();return(0,eT.jsx)("button",{type:"button",onClick:r=>{r.stopPropagation(),a(e,t,n)},className:(0,ny.cn)("inline-flex items-center gap-1 font-mono text-xs text-foreground/80 underline decoration-border underline-offset-2 transition-colors hover:text-foreground hover:decoration-foreground",r),children:i??(0,eT.jsxs)(eT.Fragment,{children:[e,null!=t?`:${t}`:""]})})}let lD={security:"security",types:"types",deps:"deps",lint:"lint",database:"database",tests:"tests",perf:"performance",a11y:"accessibility",env:"env",network:"network",docs:"docs"};function lL({label:e,value:t,sub:n,accent:r,onClick:i}){let a=(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e}),i&&(0,eT.jsx)(a4,{className:"size-3.5 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5"})]}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:r},children:t}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:n})]});return i?(0,eT.jsx)("button",{type:"button",onClick:i,className:"group flex flex-col gap-2 overflow-hidden rounded-xl bg-card p-4 text-left text-card-foreground ring-1 ring-foreground/10 transition-colors hover:ring-foreground/25",children:a}):(0,eT.jsx)(s8,{className:"gap-2 p-4",children:a})}function lU({category:e,onSelect:t}){var n;let r=(n=e.score)>=80?"var(--sev-ok)":n>=60?"var(--sev-medium)":n>=40?"var(--sev-high)":"var(--sev-critical)";return(0,eT.jsxs)("button",{type:"button",onClick:t,disabled:!t,className:"group flex flex-col gap-1.5 rounded-sm p-1.5 text-left transition-colors enabled:hover:bg-secondary/50",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,eT.jsx)("span",{className:"truncate text-muted-foreground group-enabled:group-hover:text-foreground",children:e.label}),(0,eT.jsxs)("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/60",children:[e.issues," ",1===e.issues?"issue":"issues"]})]}),(0,eT.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,eT.jsx)("span",{className:"font-mono tabular-nums",style:{color:r},children:e.score}),t&&(0,eT.jsx)(a4,{className:"size-3 text-muted-foreground/40 transition-transform group-hover:translate-x-0.5"})]})]}),(0,eT.jsx)(om,{value:e.score,className:"h-1.5"})]})}function lZ({icon:e,label:t,value:n,onClick:r}){let i=(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(e,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70",children:t}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:n})]})]}),a="flex min-w-0 items-center gap-2.5 rounded-sm px-3 py-2";return r?(0,eT.jsx)("button",{type:"button",onClick:r,className:`${a} text-left transition-colors hover:bg-secondary/50`,children:i}):(0,eT.jsx)("div",{className:a,children:i})}function lF({report:e,history:t,insights:n,onSelectTab:r}){let i,a,{lint:s,types:o,security:l}=e,{viewIssue:d,viewFile:c}=l$(),u=ok(e,n),m=l.findings.filter(e=>"critical"===e.severity).length,p=l.findings.filter(e=>"high"===e.severity).length,f=t.length>=2?t[t.length-2].score:null,h=null!=f?u.score-f:null,g=function(e){let{lint:t,types:n,security:r}=e,i=[];for(let e of r.findings)("critical"===e.severity||"high"===e.severity)&&i.push({id:`sec-${e.id}`,icon:eB,severity:e.severity,title:e.title,detail:`${e.filePath}:${e.line}`,issue:oK(e)});for(let e of r.dependencies)e.fixedIn&&("critical"===e.severity||"high"===e.severity)&&i.push({id:`dep-${e.name}`,icon:s6,severity:e.severity,title:`Upgrade ${e.name} to ${e.fixedIn}`,detail:e.cves.join(", ")||e.title,tab:"deps"});return t.fixableCount>0&&i.push({id:"lint-fix",icon:s4,severity:"warning",title:`Auto-fix ${t.fixableCount} lint ${1===t.fixableCount?"issue":"issues"}`,detail:"eslint . --fix",tab:"lint"}),n.diagnostics.length>0&&i.push({id:"types",icon:s5,severity:"high",title:`Resolve ${n.diagnostics.length} type ${1===n.diagnostics.length?"error":"errors"}`,detail:"tsc --noEmit",tab:"types"}),i.sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank).slice(0,6)}(e),x=(i=new Map,a=e=>i.set(e,(i.get(e)??0)+1),e.lint.messages.forEach(e=>a(e.filePath)),e.types.diagnostics.forEach(e=>a(e.filePath)),e.security.findings.forEach(e=>a(e.filePath)),[...i.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,8)),v=u.categories.reduce((e,t)=>e+t.issues,0),y=u.categories.filter(e=>0===e.issues).length,b=e=>{e&&r&&r(e)},k=["critical","high","medium","low","info"].map((e,t)=>({label:oV(e).label,value:l.findings.filter(t=>t.severity===e).length,color:`var(--chart-${t+1})`}));return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Project health"}),(0,eT.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Weighted across ",u.categories.length," analysis surfaces"]})]}),(0,eT.jsx)(o_,{report:e,insights:n})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-4 p-6",children:[(0,eT.jsx)(oh,{score:u.score,grade:u.grade}),(0,eT.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[null!=h&&(0,eT.jsxs)("span",{className:"font-mono tabular-nums",style:{color:h>=0?"var(--sev-ok)":"var(--sev-critical)"},children:[h>=0?"+":"",h]}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:"vs previous run"})]})]}),(0,eT.jsxs)(s8,{className:"flex flex-col gap-3 p-6 lg:col-span-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold",children:"Score breakdown"}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:"issues · score"})]}),(0,eT.jsx)("div",{className:"grid gap-x-4 gap-y-1 sm:grid-cols-2",children:u.categories.map(e=>(0,eT.jsx)(lU,{category:e,onSelect:r?()=>b(lD[e.key]):void 0},e.key))})]})]}),(0,eT.jsxs)(s8,{className:"grid grid-cols-2 gap-1 p-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,eT.jsx)(lZ,{icon:te,label:"Framework",value:e.meta.project.framework}),(0,eT.jsx)(lZ,{icon:s9,label:"Package manager",value:e.meta.project.packageManager}),(0,eT.jsx)(lZ,{icon:s3,label:"AI review",value:e.meta.aiEnabled?"Enabled":"Skipped",onClick:r?()=>b("security"):void 0}),(0,eT.jsx)(lZ,{icon:i4,label:"Duration",value:`${(e.meta.durationMs/1e3).toFixed(1)}s`}),(0,eT.jsx)(lZ,{icon:eB,label:"Total issues",value:String(v)}),(0,eT.jsx)(lZ,{icon:s9,label:"Clean surfaces",value:`${y}/${u.categories.length}`})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,eT.jsxs)(s8,{className:"flex flex-col gap-3 p-6 lg:col-span-3",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold",children:"Health trend"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>b("trends"),disabled:!r,className:"inline-flex items-center gap-1 font-mono text-xs text-muted-foreground transition-colors enabled:hover:text-foreground",children:[t.length," runs",r&&(0,eT.jsx)(s2,{className:"size-3"})]})]}),(0,eT.jsx)(og,{data:t})]}),(0,eT.jsx)(lL,{label:"Lint errors",value:s.errorCount,sub:`${s.warningCount} warnings \xb7 ${s.fixableCount} auto-fixable`,accent:s.errorCount>0?"var(--sev-critical)":"var(--sev-ok)",onClick:r?()=>b("lint"):void 0}),(0,eT.jsx)(lL,{label:"Type errors",value:o.diagnostics.length,sub:o.unavailable?"TypeScript not detected":"from tsc --noEmit",accent:o.diagnostics.length>0?"var(--sev-high)":"var(--sev-ok)",onClick:r?()=>b("types"):void 0}),(0,eT.jsx)(lL,{label:"Security findings",value:l.findings.length,sub:`${m} critical \xb7 ${p} high \xb7 ${l.dependencies.length} vuln deps`,accent:m>0?"var(--sev-critical)":p>0?"var(--sev-high)":"var(--sev-ok)",onClick:r?()=>b("security"):void 0}),(0,eT.jsx)("div",{className:"lg:col-span-2",children:(0,eT.jsx)(oS,{title:"Recommended next actions",children:0===g.length?(0,eT.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"All clear — nothing urgent to address."}):(0,eT.jsx)("ol",{className:"flex flex-col",children:g.map((e,t)=>{let n=oV(e.severity),r=e.icon;return(0,eT.jsx)("li",{className:"border-t border-border first:border-t-0",children:(0,eT.jsxs)("button",{type:"button",onClick:()=>{e.issue?d(e.issue):b(e.tab)},className:"group flex w-full items-start gap-3 py-2.5 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:"mt-0.5 font-mono text-xs tabular-nums text-muted-foreground",children:String(t+1).padStart(2,"0")}),(0,eT.jsx)(r,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.detail})]}),(0,eT.jsx)("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${n.bg} ${n.text}`,children:n.label}),(0,eT.jsx)(a4,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40 transition-transform group-hover:translate-x-0.5"})]})},e.id)})})})}),(0,eT.jsx)(oS,{title:"Findings by severity",action:r?(0,eT.jsxs)("button",{type:"button",onClick:()=>b("security"),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:["view ",(0,eT.jsx)(s2,{className:"size-3"})]}):void 0,children:(0,eT.jsx)(o$,{segments:k})}),(0,eT.jsx)("div",{className:"lg:col-span-3",children:(0,eT.jsx)(oS,{title:"Most affected files",action:(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:["issues ",(0,eT.jsx)(s2,{className:"size-3"})]}),children:(0,eT.jsx)("div",{className:"sm:columns-2 sm:gap-6",children:(0,eT.jsx)(oI,{rows:x,emptyLabel:"No issues across any files.",onSelect:e=>c(e)})})})})]})]})}let lB=eL("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),lV=eL("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),lq=eL("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),lW=eL("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),lH=eL("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),lG=[{key:"score",label:"Health score",invert:!1,stroke:"var(--chart-1)"},{key:"lintErrors",label:"Lint errors",invert:!0,stroke:"var(--chart-2)"},{key:"lintWarnings",label:"Lint warnings",invert:!0,stroke:"var(--chart-3)"},{key:"typeErrors",label:"Type errors",invert:!0,stroke:"var(--chart-4)"},{key:"securityFindings",label:"Security findings",invert:!0,stroke:"var(--chart-5)"}];function lK({history:e,report:t}){let[n,r]=(0,eP.useState)("score"),[i,a]=(0,eP.useState)(null),s=lG.find(e=>e.key===n),o=(0,eP.useMemo)(()=>[...e].reverse(),[e]);if(0===e.length)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(lW,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No run history yet"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["Projectlens records a trend point after every analysis in ",(0,eT.jsx)("span",{className:"font-mono",children:".projectlens/history.json"}),". Run checks a few times to watch your project's health evolve here."]})]})]});let l=e[0],d=e[e.length-1],c=d.score-l.score;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:lG.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.key),className:(0,ny.cn)("flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm transition-colors",n===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)("span",{className:"size-2 rounded-[2px]",style:{background:e.stroke},"aria-hidden":!0}),e.label]},e.key))}),(0,eT.jsx)(s8,{className:"p-4",children:(0,eT.jsx)(lJ,{points:e,metric:s,hover:i,onHover:a})}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)(lW,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"font-mono text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Run history"}),(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:[e.length," runs"]})]}),(0,eT.jsx)("div",{className:"overflow-hidden rounded-sm border border-border",children:(0,eT.jsxs)("table",{className:"w-full text-sm",children:[(0,eT.jsx)("thead",{children:(0,eT.jsxs)("tr",{className:"border-b border-border bg-secondary/30 text-left font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:[(0,eT.jsx)("th",{className:"px-3 py-2 font-medium",children:"When"}),(0,eT.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Score"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Lint"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Types"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Security"}),(0,eT.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Δ"})]})}),(0,eT.jsx)("tbody",{children:o.map((t,n)=>{let r=e.length-1-n-1,i=r>=0?e[r]:null,a=i?t.score-i.score:0,s=0===n;return(0,eT.jsxs)("tr",{className:(0,ny.cn)("border-b border-border last:border-0 transition-colors hover:bg-secondary/30",s&&"bg-secondary/20"),children:[(0,eT.jsxs)("td",{className:"px-3 py-2 font-mono text-xs text-foreground",children:[l0(t.timestamp),s&&(0,eT.jsx)("span",{className:"ml-2 rounded-sm bg-primary px-1 py-0.5 font-mono text-[9px] uppercase text-primary-foreground",children:"latest"})]}),(0,eT.jsx)("td",{className:"px-3 py-2 text-right font-mono text-foreground",children:t.score}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.lintErrors+t.lintWarnings}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.typeErrors}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.securityFindings}),(0,eT.jsx)("td",{className:"px-3 py-2 text-right",children:(0,eT.jsx)(lY,{value:a})})]},t.runId)})})]})})]})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)(oS,{title:"Current",children:[(0,eT.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-4xl font-semibold tabular-nums text-foreground",children:t.health.score}),(0,eT.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:"/ 100"})]}),(0,eT.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-xs text-foreground",children:t.health.grade}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"grade"})]})]}),(0,eT.jsx)(oS,{title:"Since first run",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsx)(lX,{label:"Score change",value:lQ(c),positive:c>0,negative:c<0}),(0,eT.jsx)(lX,{label:"Lint resolved",value:lQ(l.lintErrors+l.lintWarnings-(d.lintErrors+d.lintWarnings)),positive:l.lintErrors+l.lintWarnings-(d.lintErrors+d.lintWarnings)>0}),(0,eT.jsx)(lX,{label:"Type errors fixed",value:lQ(l.typeErrors-d.typeErrors),positive:l.typeErrors-d.typeErrors>0}),(0,eT.jsx)(lX,{label:"Security closed",value:lQ(l.securityFindings-d.securityFindings),positive:l.securityFindings-d.securityFindings>0})]})}),(0,eT.jsx)(oS,{title:"Best & worst",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5 text-sm",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Peak score"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.max(...e.map(e=>e.score))})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Lowest score"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.min(...e.map(e=>e.score))})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Average"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.round(e.reduce((e,t)=>e+t.score,0)/e.length)})]})]})})]})]})}function lJ({points:e,metric:t,hover:n,onHover:r}){if(e.length<2)return(0,eT.jsx)("div",{className:"flex h-[140px] items-center justify-center text-xs text-muted-foreground",children:"Need at least two runs to plot a trend."});let i=e.map(e=>e[t.key]),a=Math.max(...i),s=Math.min(...i),o=a-s||1,l=e.map((n,r)=>({x:r/(e.length-1)*100,y:8+(1-(n[t.key]-s)/o)*124,p:n})),d=l.map((e,t)=>`${0===t?"M":"L"} ${e.x} ${e.y}`).join(" "),c=`${d} L 100 140 L 0 140 Z`,u=null!=n?l[n]:l[l.length-1];return(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsxs)("svg",{viewBox:"0 0 100 140",preserveAspectRatio:"none",className:"h-[160px] w-full overflow-visible",role:"img","aria-label":`${t.label} across ${e.length} runs`,children:[(0,eT.jsx)("defs",{children:(0,eT.jsxs)("linearGradient",{id:`fill-${t.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,eT.jsx)("stop",{offset:"0%",stopColor:t.stroke,stopOpacity:"0.25"}),(0,eT.jsx)("stop",{offset:"100%",stopColor:t.stroke,stopOpacity:"0"})]})}),[.25,.5,.75].map(e=>(0,eT.jsx)("line",{x1:"0",x2:100,y1:8+124*e,y2:8+124*e,stroke:"var(--border)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",strokeDasharray:"2 2"},e)),(0,eT.jsx)("path",{d:c,fill:`url(#fill-${t.key})`}),(0,eT.jsx)("path",{d:d,fill:"none",stroke:t.stroke,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"}),null!=n&&(0,eT.jsx)("line",{x1:u.x,x2:u.x,y1:8,y2:140,stroke:"var(--foreground)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",strokeOpacity:"0.4"}),(0,eT.jsx)("circle",{cx:u.x,cy:u.y,r:"2.5",fill:t.stroke,vectorEffect:"non-scaling-stroke"}),l.map((t,n)=>(0,eT.jsx)("rect",{x:t.x-100/e.length/2,y:0,width:100/e.length,height:140,fill:"transparent",onMouseEnter:()=>r(n),onMouseLeave:()=>r(null)},n))]}),(0,eT.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"font-mono text-muted-foreground",children:l0(u.p.timestamp)}),(0,eT.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,eT.jsxs)("span",{className:"text-muted-foreground",children:[t.label,":"]}),(0,eT.jsx)("span",{className:"font-mono font-semibold text-foreground",children:u.p[t.key]})]})]})]})}function lY({value:e}){if(0===e)return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-0.5 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(lq,{className:"size-3"}),"0"]});let t=e>0;return(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-0.5 font-mono text-xs",t?"text-foreground":"text-muted-foreground"),children:[t?(0,eT.jsx)(lB,{className:"size-3"}):(0,eT.jsx)(lV,{className:"size-3"}),lQ(e)]})}function lX({label:e,value:t,positive:n,negative:r}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1 font-mono",n?"font-semibold text-foreground":r?"text-muted-foreground":"text-foreground"),children:[n?(0,eT.jsx)(lB,{className:"size-3"}):r?(0,eT.jsx)(lV,{className:"size-3"}):(0,eT.jsx)(lH,{className:"size-3"}),t]})]})}function lQ(e){return e>0?`+${e}`:`${e}`}function l0(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})+" "+t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}let l1=eL("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),l2=eL("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),l4=eL("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),l5=eL("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),l6={high:"High",medium:"Medium",low:"Low"};function l3(){let e=lN(lm),t=lN(lk),n=lu(),{viewIssue:r}=l$(),[i,a]=(0,eP.useState)(""),[s,o]=(0,eP.useState)("all"),[l,d]=(0,eP.useState)("all"),[c,u]=(0,eP.useState)(""),[m,p]=(0,eP.useState)(""),[f,h]=(0,eP.useState)(!1),[g,x]=(0,eP.useState)(null),[v,y]=(0,eP.useState)(null),[b,k]=(0,eP.useState)(null),[j,w]=(0,eP.useState)(null),N=(0,eP.useMemo)(()=>e.filter(e=>("all"===s||e.priority===s)&&("all"===l||("none"===l?!e.groupId:e.groupId===l))),[e,s,l]),_=(0,eP.useMemo)(()=>{let t=new Map,n=0;for(let r of e)r.groupId?t.set(r.groupId,(t.get(r.groupId)??0)+1):n++;return{map:t,ungrouped:n}},[e]),S=(0,eP.useMemo)(()=>{let e={};for(let t of n)e[t.id]=[];for(let t of N)e[t.columnId]||(e[t.columnId]=[]),e[t.columnId].push(t);return e},[N,n]),$=(0,eP.useMemo)(()=>new Set(n.filter(e=>e.done).map(e=>e.id)),[n]),I=e.filter(e=>$.has(e.columnId)).length;function E(e){e.issue?r(e.issue):x(e)}function C(){y(null),k(null),w(null)}return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=i.trim();t&&(lf({title:t,groupId:"all"!==l&&"none"!==l?l:void 0,columnId:n[0]?.id}),a(""))},className:"flex flex-1 items-center gap-2",children:[(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(oO,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:i,onChange:e=>a(e.target.value),placeholder:"Add a task…",className:"w-full rounded-sm border border-border bg-card py-2 pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring","aria-label":"New task title"})]}),(0,eT.jsx)("button",{type:"submit",disabled:!i.trim(),className:"rounded-sm bg-primary px-3 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-40",children:"Add"})]}),(0,eT.jsx)("div",{className:"flex items-center gap-1 rounded-sm border border-border bg-card p-1",children:["all","high","medium","low"].map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>o(e),className:(0,ny.cn)("rounded-sm px-2.5 py-1 text-xs capitalize transition-colors",s===e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e},e))})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)(de,{label:"All",count:e.length,active:"all"===l,onClick:()=>d("all")}),_.ungrouped>0&&(0,eT.jsx)(de,{label:"Ungrouped",count:_.ungrouped,active:"none"===l,onClick:()=>d("none")}),t.map(e=>(0,eT.jsx)(de,{label:e.name,count:_.map.get(e.id)??0,active:l===e.id,onClick:()=>d(e.id),onRemove:()=>{var t;t=e.id,lj(lk().filter(e=>e.id!==t)),lp(lm().map(e=>e.groupId===t?{...e,groupId:void 0}:e)),l===e.id&&d("all")}},e.id)),(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=c.trim();if(!t)return;let n=lw(t);u(""),d(n.id)},className:"ml-auto flex items-center gap-1",children:[(0,eT.jsx)("input",{value:c,onChange:e=>u(e.target.value),placeholder:"New group…","aria-label":"New group name",className:"w-32 rounded-sm border border-border bg-card px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"submit",disabled:!c.trim(),"aria-label":"Create group",className:"inline-flex size-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:(0,eT.jsx)(oO,{className:"size-3.5"})})]})]}),0===e.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(e7,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No tasks yet"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["Add a task above, or open any finding across the dashboard and click"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Track task"})," to capture it here. Drag cards between columns, and use the column menu to rename or remove columns."]})]})]}):(0,eT.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-2",children:[n.map(e=>(0,eT.jsx)(l9,{column:e,tasks:S[e.id]??[],groups:t,isDropTarget:b===e.id,overTask:j,dragId:v,showClear:!!e.done&&I>0,canDelete:n.length>1,onClear:lb,onRename:t=>{var n;return n=e.id,void lc(ld().map(e=>e.id===n?{...e,name:t.trim()}:e))},onDelete:()=>(function(e){let t=ld();if(t.length<=1)return;let n=t.filter(t=>t.id!==e);lc(n);let r=n[0].id;lp(lm().map(t=>t.columnId===e?{...t,columnId:r}:t))})(e.id),onOpenTask:E,onDragStartTask:e=>y(e),onDragEndTask:C,onColumnDragOver:()=>{k(e.id),w(null)},onColumnDrop:()=>{var t;return t=e.id,void(v&&lv(v,t),C())},onTaskDragOver:t=>{w(t),k(e.id)},onTaskDrop:t=>{var n;return n=e.id,void(v&&v!==t&&lv(v,n,t),C())}},e.id)),(0,eT.jsx)("div",{className:"w-72 shrink-0",children:f?(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=m.trim();t&&(!function(e){let t={id:ll("col"),name:e.trim()},n=ld(),r=n.findIndex(e=>e.done);if(r>=0){let e=[...n];e.splice(r,0,t),lc(e)}else lc([...n,t])}(t),p(""),h(!1))},className:"flex items-center gap-1 rounded-sm border border-border bg-card p-2",children:[(0,eT.jsx)("input",{autoFocus:!0,value:m,onChange:e=>p(e.target.value),onBlur:()=>!m.trim()&&h(!1),placeholder:"Column name…","aria-label":"New column name",className:"w-full rounded-sm border border-border bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"submit",disabled:!m.trim(),"aria-label":"Confirm new column",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-sm bg-primary text-primary-foreground disabled:opacity-40",children:(0,eT.jsx)(iq,{className:"size-3.5"})})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-sm border border-dashed border-border bg-card/40 py-2.5 font-mono text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground",children:[(0,eT.jsx)(oO,{className:"size-3.5"}),"Add column"]})})]}),(0,eT.jsx)(l7,{task:g,columns:n,groups:t,onClose:()=>x(null),onViewIssue:e=>{x(null),r(e)}})]})}function l9({column:e,tasks:t,groups:n,isDropTarget:r,overTask:i,dragId:a,showClear:s,canDelete:o,onClear:l,onRename:d,onDelete:c,onOpenTask:u,onDragStartTask:m,onDragEndTask:p,onColumnDragOver:f,onColumnDrop:h,onTaskDragOver:g,onTaskDrop:x}){let[v,y]=(0,eP.useState)(!1),[b,k]=(0,eP.useState)(e.name),j=(0,eP.useRef)(null);function w(){let t=b.trim();t&&t!==e.name?d(t):k(e.name),y(!1)}return(0,eT.jsxs)("div",{className:"flex w-72 shrink-0 flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("size-2 shrink-0 rounded-full",e.done?"bg-foreground":"bg-muted-foreground"),"aria-hidden":!0}),v?(0,eT.jsx)("input",{ref:j,autoFocus:!0,value:b,onChange:e=>k(e.target.value),onBlur:w,onKeyDown:t=>{"Enter"===t.key&&w(),"Escape"===t.key&&(k(e.name),y(!1))},className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-1.5 py-0.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","aria-label":"Column name"}):(0,eT.jsx)("h3",{className:"truncate font-mono text-xs font-semibold uppercase tracking-wide text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:t.length}),(0,eT.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[s&&(0,eT.jsxs)("button",{type:"button",onClick:l,className:"inline-flex items-center gap-1 font-mono text-[10px] uppercase text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(l1,{className:"size-3"}),"clear"]}),(0,eT.jsxs)(a5,{children:[(0,eT.jsx)(a6,{"aria-label":"Column options",className:"inline-flex size-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:(0,eT.jsx)(l4,{className:"size-3.5"})}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-40",children:[(0,eT.jsxs)(a8,{onClick:()=>{k(e.name),y(!0)},children:[(0,eT.jsx)(l5,{className:"size-3.5 text-muted-foreground"}),"Rename column"]}),(0,eT.jsxs)(a8,{variant:"destructive",disabled:!o,onClick:c,children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete column"]})]})]})]})]}),(0,eT.jsx)("div",{onDragOver:e=>{e.preventDefault(),f()},onDrop:e=>{e.preventDefault(),h()},className:(0,ny.cn)("flex min-h-24 flex-1 flex-col gap-2 rounded-sm border border-dashed p-2 transition-colors",r?"border-foreground/40 bg-secondary/40":"border-border"),children:0===t.length?(0,eT.jsx)("p",{className:"px-1 py-4 text-center font-mono text-[11px] text-muted-foreground/60",children:a?"drop here":"empty"}):t.map(e=>(0,eT.jsx)(l8,{task:e,groups:n,isDragging:a===e.id,showInsertLine:i===e.id&&null!==a&&a!==e.id,onOpen:()=>u(e),onDragStart:()=>m(e.id),onDragEnd:p,onDragOver:()=>g(e.id),onDrop:()=>x(e.id)},e.id))})]})}function l8({task:e,groups:t,isDragging:n,showInsertLine:r,onOpen:i,onDragStart:a,onDragEnd:s,onDragOver:o,onDrop:l}){let d=t.find(t=>t.id===e.groupId);return(0,eT.jsx)("div",{draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.id),a()},onDragEnd:s,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),o()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),l()},className:(0,ny.cn)("rounded-sm transition-opacity",r&&"border-t-2 border-foreground/50 pt-0.5",n&&"opacity-40"),children:(0,eT.jsxs)(s8,{className:"group gap-0 p-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,eT.jsx)(l2,{className:"mt-0.5 size-3.5 shrink-0 cursor-grab text-muted-foreground/40","aria-hidden":!0}),(0,eT.jsx)(dt,{priority:e.priority}),(0,eT.jsx)("button",{type:"button",onClick:i,className:"min-w-0 flex-1 text-pretty text-left text-sm leading-snug text-foreground transition-colors hover:text-foreground",children:e.title}),e.issue&&(0,eT.jsx)(oE,{className:"mt-0.5 size-3 shrink-0 text-muted-foreground/50","aria-hidden":!0}),(0,eT.jsx)("button",{type:"button",onClick:()=>ly(e.id),"aria-label":"Delete task",className:"shrink-0 text-muted-foreground/50 opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(e.source||e.filePath||d)&&(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 pl-5",children:[d&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border bg-background px-1.5 py-0.5 font-mono text-[9px] text-foreground",children:[(0,eT.jsx)("span",{className:"size-1.5 rounded-full bg-foreground","aria-hidden":!0}),d.name]}),e.source&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[9px] uppercase text-muted-foreground",children:e.source}),e.filePath&&(0,eT.jsx)(lR,{path:e.filePath,line:e.line,className:"text-[10px]"})]})]})})}function l7({task:e,columns:t,groups:n,onClose:r,onViewIssue:i}){return(0,eT.jsx)(sO,{open:null!==e,onOpenChange:e=>!e&&r(),children:(0,eT.jsx)(sL,{className:"sm:max-w-md",children:e&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(sU,{children:[(0,eT.jsx)(sZ,{className:"text-pretty pr-6",children:e.title}),(0,eT.jsxs)(sF,{children:["Created ",new Date(e.createdAt).toLocaleString()," · Updated"," ",new Date(e.updatedAt).toLocaleString()]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Column",(0,eT.jsx)("select",{value:e.columnId,onChange:t=>lx(e.id,{columnId:t.target.value}),className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:t.map(e=>(0,eT.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Priority",(0,eT.jsx)("select",{value:e.priority,onChange:t=>lx(e.id,{priority:t.target.value}),className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:["high","medium","low"].map(e=>(0,eT.jsx)("option",{value:e,children:l6[e]},e))})]})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Group",(0,eT.jsxs)("select",{value:e.groupId??"",onChange:t=>{lx(e.id,{groupId:t.target.value||void 0})},className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:[(0,eT.jsx)("option",{value:"",children:"No group"}),n.map(e=>(0,eT.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Notes",(0,eT.jsx)("textarea",{value:e.note??"",onChange:t=>lx(e.id,{note:t.target.value}),rows:4,placeholder:"Add details, links, or a remediation plan…",className:"resize-y rounded-sm border border-border bg-background px-2 py-1.5 text-sm leading-relaxed text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),e.source&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 rounded-sm border border-border bg-background p-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.source}),e.severity&&(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:e.severity})]}),e.issue?.recommendation&&(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:e.issue.recommendation}),e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})}),e.issue&&o8(e.issue).length>0&&(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o8(e.issue).map(e=>(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"}),e.label]},e.href))}),e.issue&&(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.issue),className:"inline-flex items-center justify-center gap-1.5 self-start rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(oE,{className:"size-3.5 text-muted-foreground"}),"View full analysis"]})]}),!e.source&&e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{ly(e.id),r()},className:"inline-flex items-center justify-center gap-1.5 self-start rounded-sm border border-destructive/40 px-2.5 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete task"]})]})]})})})}function de({label:e,count:t,active:n,onClick:r,onRemove:i}){return(0,eT.jsxs)("span",{className:(0,ny.cn)("group/chip inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1 text-xs transition-colors",n?"border-foreground/40 bg-secondary text-foreground":"border-border bg-card text-muted-foreground hover:text-foreground"),children:[(0,eT.jsxs)("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1.5",children:[e,(0,eT.jsx)("span",{className:"font-mono text-[10px] tabular-nums text-muted-foreground",children:t})]}),i&&(0,eT.jsx)("button",{type:"button",onClick:i,"aria-label":`Delete group ${e}`,className:"text-muted-foreground/50 transition-colors hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3"})})]})}function dt({priority:e}){return(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-2 shrink-0 rounded-full","high"===e?"bg-foreground":"medium"===e?"bg-muted-foreground":"border border-muted-foreground bg-transparent"),"aria-hidden":!0,title:`${e} priority`})}function dn({active:e,onClick:t,children:n,count:r}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:`flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors ${e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[n,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:r})]})}function dr({msg:e,showFile:t}){let{viewIssue:n}=l$(),r=oV(e.severity);return(0,eT.jsx)("div",{className:"border-t border-border first:border-t-0",children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>n(oH(e)),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(oH(e)))},className:"flex w-full cursor-pointer items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${r.dot}`,"aria-hidden":!0}),(0,eT.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"text-sm text-foreground",children:e.message}),(0,eT.jsxs)("span",{className:"mt-1 flex flex-wrap items-center gap-2 font-mono text-xs text-muted-foreground",children:[t&&(0,eT.jsx)(lR,{path:e.filePath,line:e.line,column:e.column}),!t&&(0,eT.jsxs)("span",{children:[e.line,":",e.column]}),!t&&e.ruleId&&(0,eT.jsx)("span",{className:`rounded-sm px-1.5 py-0.5 ${r.bg} ${r.text}`,children:e.ruleId}),e.fixable&&(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 text-[color:var(--sev-ok)]",children:"auto-fixable"})]})]}),(0,eT.jsx)(lM,{issue:oH(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}function di({lint:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)("file"),[a,s]=(0,eP.useState)(null),o=(0,eP.useMemo)(()=>e.messages.filter(e=>(!a||e.ruleId===a)&&("all"===t||("fixable"===t?e.fixable:e.severity===t))),[e.messages,t,a]),l=(0,eP.useMemo)(()=>{let e=new Map;for(let t of o){let n="file"===r?t.filePath:t.ruleId??"(no rule)",i=e.get(n)??[];i.push(t),e.set(n,i)}return[...e.entries()].sort((e,t)=>t[1].length-e[1].length)},[o,r]),d=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.messages){let e=n.ruleId??"(no rule)";t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.messages]);return e.unavailable?(0,eT.jsxs)(s8,{className:"p-6 text-sm text-muted-foreground",children:["ESLint could not run. ",e.note]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Breakdown",children:[(0,eT.jsx)(o$,{segments:[{label:"Errors",value:e.errorCount,color:"var(--sev-critical)"},{label:"Warnings",value:e.warningCount,color:"var(--sev-medium)"}]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:[(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.fixableCount})," of"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.messages.length})," auto-fixable"]})]}),(0,eT.jsx)(oS,{title:"Rules",action:a?(0,eT.jsxs)("button",{type:"button",onClick:()=>s(null),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground hover:text-foreground",children:["clear ",(0,eT.jsx)(sz,{className:"size-3"})]}):void 0,children:(0,eT.jsx)(oI,{rows:d,activeKey:a,onSelect:e=>s(t=>t===e?null:e)})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)(dn,{active:"all"===t,onClick:()=>n("all"),count:e.messages.length,children:"All"}),(0,eT.jsx)(dn,{active:"error"===t,onClick:()=>n("error"),count:e.errorCount,children:"Errors"}),(0,eT.jsx)(dn,{active:"warning"===t,onClick:()=>n("warning"),count:e.warningCount,children:"Warnings"}),(0,eT.jsx)(dn,{active:"fixable"===t,onClick:()=>n("fixable"),count:e.fixableCount,children:"Auto-fixable"})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)("span",{className:"px-2 font-mono text-[10px] uppercase text-muted-foreground",children:"Group"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i("file"),className:`rounded-sm px-2.5 py-1.5 text-sm transition-colors ${"file"===r?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"File"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i("rule"),className:`rounded-sm px-2.5 py-1.5 text-sm transition-colors ${"rule"===r?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Rule"})]})]}),a&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 rounded-sm border border-border bg-secondary/30 px-3 py-2 text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Filtered by rule"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:a}),(0,eT.jsxs)("button",{type:"button",onClick:()=>s(null),className:"ml-auto inline-flex items-center gap-1 text-muted-foreground hover:text-foreground",children:["clear ",(0,eT.jsx)(sz,{className:"size-3"})]})]}),0===l.length?(0,eT.jsx)(s8,{className:"p-8 text-center text-sm text-muted-foreground",children:"No matching issues."}):l.map(([e,t])=>{let n="rule"===r?oV(t[0].severity):null;return(0,eT.jsxs)(s8,{className:"gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-secondary/30 px-4 py-2.5",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[n&&(0,eT.jsx)("span",{className:`size-2 shrink-0 rounded-full ${n.dot}`,"aria-hidden":!0}),"file"===r?(0,eT.jsx)(lR,{path:e,className:"truncate text-sm"}):(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:e})]}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:t.length})]}),(0,eT.jsx)("div",{children:t.map((e,t)=>(0,eT.jsx)(dr,{msg:e,showFile:"rule"===r},`${e.filePath}-${e.line}-${e.column}-${t}`))})]},e)})]})]})}let da=eL("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ds=eL("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),dl=eL("brackets",[["path",{d:"M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3",key:"1kt8lf"}],["path",{d:"M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3",key:"gduv9"}]]),dd=eL("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]),dc=eL("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),du=eL("square-function",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]]),dm=eL("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),dp=eL("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),df={interface:{label:"interface",icon:eF,color:"var(--chart-1)"},type:{label:"type",icon:dl,color:"var(--chart-2)"},enum:{label:"enum",icon:dd,color:"var(--chart-3)"},class:{label:"class",icon:dc,color:"var(--chart-4)"},function:{label:"function",icon:du,color:"var(--chart-5)"}};function dh({m:e}){return(0,eT.jsxs)("div",{className:"flex items-baseline gap-2 border-t border-border py-2 font-mono text-xs first:border-t-0",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[e.readonly&&(0,eT.jsx)(dm,{className:"size-3 text-muted-foreground","aria-label":"readonly"}),e.name,e.optional&&(0,eT.jsx)("span",{className:"text-muted-foreground",children:"?"})]}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:":"}),(0,eT.jsx)("span",{className:"text-[color:var(--chart-2)]",children:e.type}),e.doc&&(0,eT.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:e.doc})]})}function dg({def:e,onSelectName:t}){let n=df[e.kind];return(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(n.icon,{className:"size-4",style:{color:n.color}}),(0,eT.jsx)("span",{className:"font-mono text-sm font-semibold text-foreground",children:e.name})]}),e.generics&&e.generics.length>0&&(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:`<${e.generics.join(", ")}>`}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-[10px] uppercase",children:n.label}),e.exported?(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:"exported"}):(0,eT.jsx)(nS,{variant:"outline",className:"font-mono text-[10px] uppercase text-muted-foreground",children:"local"})]}),e.doc&&(0,eT.jsx)("p",{className:"mt-2 text-pretty text-sm leading-relaxed text-muted-foreground",children:e.doc}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(dp,{className:"size-3"}),e.references," refs"]})]}),e.extendsFrom&&e.extendsFrom.length>0&&(0,eT.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"extends"}),e.extendsFrom.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>t(e),className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground hover:bg-secondary/70",children:[e,(0,eT.jsx)(oE,{className:"size-2.5"})]},e))]}),e.members.length>0&&(0,eT.jsxs)("div",{className:"mt-4",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["enum"===e.kind?"Members":"Properties"," (",e.members.length,")"]}),(0,eT.jsx)("div",{className:"mt-1",children:e.members.map(e=>(0,eT.jsx)(dh,{m:e},e.name))})]}),(0,eT.jsxs)("div",{className:"mt-4",children:[(0,eT.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Declaration"}),(0,eT.jsx)("pre",{className:"mt-1 overflow-x-auto rounded-sm border border-border bg-background p-3 font-mono text-xs leading-relaxed text-foreground",children:(0,eT.jsx)("code",{children:e.source})})]})]})}function dx({definitions:e}){let[t,n]=(0,eP.useState)(""),[r,i]=(0,eP.useState)("all"),[a,s]=(0,eP.useState)(e[0]?.id??""),o=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:df[e].label,count:t})).sort((e,t)=>t.count-e.count)},[e]),l=(0,eP.useMemo)(()=>{let n=t.trim().toLowerCase();return e.filter(e=>"all"===r||e.kind===r).filter(e=>!n||e.name.toLowerCase().includes(n)||e.filePath.toLowerCase().includes(n)).sort((e,t)=>t.references-e.references)},[e,r,t]),d=(0,eP.useMemo)(()=>e.find(e=>e.id===a)??l[0]??e[0],[e,a,l]),c=e.filter(e=>e.exported).length,u=[{key:"all",label:"All",count:e.length},...o.map(e=>({key:e.key,label:e.label,count:e.count}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[300px_1fr]",children:[(0,eT.jsxs)("aside",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)(oS,{title:"Type inventory",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"declared"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:c}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"exported"})]})]})}),(0,eT.jsx)(oS,{title:"By kind",children:(0,eT.jsx)(oI,{rows:o,activeKey:"all"===r?null:r,onSelect:e=>i(t=>t===e?"all":e)})}),(0,eT.jsxs)(s8,{className:"gap-0 p-3",children:[(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:t,onChange:e=>n(e.target.value),placeholder:"Filter types…",className:"w-full rounded-sm border border-border bg-background py-1.5 pl-8 pr-2 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-ring"})]}),(0,eT.jsx)("div",{className:"mt-3 flex flex-wrap gap-1",children:u.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("rounded-sm px-2 py-0.5 text-xs transition-colors",r===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label},e.key))}),(0,eT.jsx)("div",{className:"mt-3 flex max-h-[460px] flex-col overflow-y-auto",children:0===l.length?(0,eT.jsx)("p",{className:"py-6 text-center text-xs text-muted-foreground",children:"No types match."}):l.map(e=>{let t=df[e.kind],n=d?.id===e.id;return(0,eT.jsxs)("button",{type:"button",onClick:()=>s(e.id),className:(0,ny.cn)("flex items-center gap-2 rounded-sm border-t border-border px-2 py-2 text-left transition-colors first:border-t-0",n?"bg-secondary":"hover:bg-secondary/40"),children:[(0,eT.jsx)(t.icon,{className:"size-3.5 shrink-0",style:{color:t.color}}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:e.name}),!e.exported&&(0,eT.jsx)(dm,{className:"size-3 shrink-0 text-muted-foreground","aria-label":"local"}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:e.references})]},e.id)})})]})]}),(0,eT.jsx)("div",{className:"min-w-0",children:d?(0,eT.jsx)(dg,{def:d,onSelectName:function(t){let n=e.find(e=>e.name===t);n&&s(n.id)}}):(0,eT.jsx)(s8,{className:"p-6 text-sm text-muted-foreground",children:"Select a type to explore its shape."})})]})}function dv({diag:e}){let{viewIssue:t}=l$(),n=e.related.length>0;return(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oG(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oG(e)))},className:"flex w-full cursor-pointer items-start gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(si,{className:"size-3.5 shrink-0"}),(0,eT.jsx)(lR,{path:e.filePath,line:e.line,column:e.column}),(0,eT.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[n&&(0,eT.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(oT,{className:"size-3.5"}),e.related.length]}),(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-high)]/12 px-1.5 py-0.5 text-[color:var(--sev-high)]",children:e.code})]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.message})]}),(0,eT.jsx)(lM,{issue:oG(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}function dy({types:e}){let t=e.definitions??[],[n,r]=(0,eP.useState)("diagnostics");if(e.unavailable)return(0,eT.jsxs)(s8,{className:"p-6 text-sm text-muted-foreground",children:["TypeScript was not detected in this project. ",e.note]});let i=[{key:"diagnostics",label:"Diagnostics",icon:ds,count:e.diagnostics.length},{key:"explorer",label:"Type explorer",icon:eF,count:t.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:i.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.key),disabled:"explorer"===e.key&&0===t.length,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors disabled:opacity-40",n===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-4"}),e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"explorer"===n&&t.length>0?(0,eT.jsx)(dx,{definitions:t}):(0,eT.jsx)(db,{types:e})]})}function db({types:e}){let t=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.diagnostics)t.set(n.filePath,(t.get(n.filePath)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.diagnostics]),n=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.diagnostics)t.set(n.code,(t.get(n.code)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.diagnostics]);return 0===e.diagnostics.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(da,{className:"size-8 text-[color:var(--sev-ok)]"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No type errors"}),(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"tsc --noEmit passed cleanly."})]})]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Affected files",children:(0,eT.jsx)(oI,{rows:t})}),(0,eT.jsx)(oS,{title:"Error codes",children:(0,eT.jsx)(oI,{rows:n})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(0,eT.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:[e.diagnostics.length," type ",1===e.diagnostics.length?"error":"errors"," — click to expand the diagnostic chain"]}),e.diagnostics.map((e,t)=>(0,eT.jsx)(dv,{diag:e},`${e.filePath}-${e.line}-${t}`))]})]})}let dk=eL("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),dj=eL("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),dw=eL("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function dN({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsx)(s8,{className:(0,ny.cn)("gap-0 overflow-hidden border-l-2 py-0",n.border),children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oK(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oK(e)))},className:"flex w-full cursor-pointer items-start gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(eB,{className:(0,ny.cn)("mt-0.5 size-4 shrink-0",n.text)}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.category}),(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsxs)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:[Math.round(100*e.confidence),"% conf."]})]}),(0,eT.jsx)("p",{className:"mt-2 text-pretty text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-sm leading-relaxed text-muted-foreground",children:e.description})]}),(0,eT.jsx)(lM,{issue:oK(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}let d_=["critical","high","medium","low","info"];function dS({rescanning:e,onClick:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,disabled:e,className:"inline-flex items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-60",children:[e?(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"}):(0,eT.jsx)(dk,{className:"size-3.5"}),e?"Rescanning…":"Rescan security"]})}function d$({security:e}){let[t,n]=(0,eP.useState)("all"),{rescanning:r,error:i,rescan:a}=function(e){let[t,n]=(0,eP.useState)(!1),[r,i]=(0,eP.useState)(null),a=(0,eP.useRef)(e);return(0,eP.useEffect)(()=>{a.current!==e&&(a.current=e,n(!1))},[e]),(0,eP.useEffect)(()=>{if(!t)return;let e=window.setTimeout(()=>n(!1),12e4);return()=>window.clearTimeout(e)},[t]),{rescanning:t,error:r,rescan:(0,eP.useCallback)(async()=>{i(null),n(!0);try{let e=await fetch("/api/run?scope=security",{method:"POST"});if(!e.ok&&409!==e.status)throw Error(501===e.status?"Rescan needs the Projectlens CLI backend":`Rescan failed (${e.status})`)}catch(e){n(!1),i(e instanceof Error?e.message:"Rescan failed")}},[])}}(e),s=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),o=(0,eP.useMemo)(()=>"all"===t?s:s.filter(e=>e.severity===t),[s,t]),l=(0,eP.useMemo)(()=>{let t=[{key:"all",label:"All",count:e.findings.length}];for(let n of d_){let r=e.findings.filter(e=>e.severity===n).length;r>0&&t.push({key:n,label:oV(n).label,count:r})}return t},[e.findings]),d=["critical","high","medium","low","info"].map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})),c=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.category,(t.get(n.category)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),u=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.filePath,(t.get(n.filePath)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]);if(e.skipped)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(eB,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"AI security audit skipped"}),(0,eT.jsx)("p",{className:"max-w-sm text-pretty text-sm text-muted-foreground",children:"No AI key was configured. Set AI_GATEWAY_API_KEY to enable the code review and dependency prioritization."})]}),(0,eT.jsx)(dS,{rescanning:r,onClick:a}),i&&(0,eT.jsx)("p",{className:"font-mono text-xs text-[color:var(--sev-critical)]",children:i})]});let m=e.findings.filter(e=>"critical"===e.severity||"high"===e.severity).length,p=e.findings.length>0?Math.round(e.findings.reduce((e,t)=>e+t.confidence,0)/e.findings.length*100):0;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Posture",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.findings.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"code findings"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:m}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"critical + high"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:c.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"categories"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:[p,"%"]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"avg confidence"})]})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs leading-relaxed text-muted-foreground",children:["Dependency advisories now live in the"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Dependencies"})," tab."]})]}),(0,eT.jsx)(oS,{title:"By severity",children:(0,eT.jsx)(o$,{segments:d})}),(0,eT.jsx)(oS,{title:"By category",children:(0,eT.jsx)(oI,{rows:c,emptyLabel:"No findings."})}),(0,eT.jsx)(oS,{title:"Affected files",children:(0,eT.jsx)(oI,{rows:u,emptyLabel:"No findings."})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(e.failed||i)&&(0,eT.jsxs)(s8,{className:"flex items-start gap-3 border-l-2 border-l-[color:var(--sev-high)] bg-[color:var(--sev-high)]/[0.06] p-4",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-4 shrink-0 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"AI security review error"}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-sm leading-relaxed text-muted-foreground",children:i??e.error??"The AI review failed. Results below may be incomplete."})]}),(0,eT.jsx)(dS,{rescanning:r,onClick:a})]}),e.findings.length>0&&(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:l.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eB,{className:"size-4 text-[color:var(--sev-high)]"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Code findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:o.length}),(0,eT.jsx)("span",{className:"ml-auto hidden font-mono text-xs text-muted-foreground sm:inline",children:"click a finding for full detail"}),!e.failed&&!i&&(0,eT.jsx)("div",{className:"ml-auto sm:ml-0",children:(0,eT.jsx)(dS,{rescanning:r,onClick:a})})]}),0===e.findings.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No code-level security issues found by the AI review."]}):0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No findings at this severity."]}):(0,eT.jsx)("div",{className:"flex flex-col gap-2",children:o.map(e=>(0,eT.jsx)(dN,{finding:e},e.id))})]})]})}let dI=eL("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);function dE(e){if(e.flagged&&e.severity)return`var(--chart-${dC(e.severity)})`;switch(e.type){case"direct":return"var(--chart-1)";case"dev":return"var(--chart-4)";default:return"var(--muted-foreground)"}}function dC(e){return({critical:1,high:2,medium:3,low:4,info:5})[e]??5}function dA({graph:e}){let[t,n]=(0,eP.useState)(null),[r,i]=(0,eP.useState)(null),[a,s]=(0,eP.useState)(null),o=(0,eP.useMemo)(()=>Math.max(...e.nodes.map(e=>e.depth)),[e.nodes]),{positioned:l,byId:d,width:c,height:u}=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.nodes){let e=t.get(n.depth)??[];e.push(n),t.set(n.depth,e)}let n=[],r=0;for(let e=0;e<=o;e++){let i=(t.get(e)??[]).sort((e,t)=>!!t.flagged!=!!e.flagged?t.flagged?1:-1:(t.sizeKb??0)-(e.sizeKb??0));r=Math.max(r,i.length),i.forEach((t,r)=>{n.push({...t,x:24+240*e,y:24+46*r})})}let i=new Map(n.map(e=>[e.id,e]));return{positioned:n,byId:i,width:48+240*o+176,height:48+46*r}},[e.nodes,o]),m=(0,eP.useMemo)(()=>{let e=[];for(let t of l)for(let n of t.dependencies){let r=d.get(n);r&&e.push({from:t,to:r})}return e},[l,d]),p=t??r,f=(0,eP.useMemo)(()=>{if(!p)return null;let e=d.get(p);return e?{deps:new Set(e.dependencies.filter(e=>d.has(e))),dependents:new Set(l.filter(e=>e.dependencies.includes(p)).map(e=>e.id))}:null},[p,d,l]),h=t?d.get(t):null,g=t?l.filter(e=>e.dependencies.includes(t)):[],x=e.nodes.filter(e=>"direct"===e.type).length,v=e.nodes.filter(e=>"dev"===e.type).length,y=e.nodes.filter(e=>e.flagged).length,b=e.nodes.reduce((e,t)=>e+(t.sizeKb??0),0);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)(s8,{className:"min-w-0 gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border p-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s9,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:"Module graph"})]}),(0,eT.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-1 rounded-sm border border-border bg-background p-0.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>s(null),className:(0,ny.cn)("rounded-sm px-2.5 py-1 text-xs transition-colors",null===a?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:"All depths"}),Array.from({length:o+1}).map((e,t)=>(0,eT.jsxs)("button",{type:"button",onClick:()=>s(e=>e===t?null:t),className:(0,ny.cn)("rounded-sm px-2.5 py-1 font-mono text-xs transition-colors",a===t?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:["L",t]},t))]})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[(0,eT.jsx)(dT,{color:"var(--chart-1)",label:"direct"}),(0,eT.jsx)(dT,{color:"var(--chart-4)",label:"dev"}),(0,eT.jsx)(dT,{color:"var(--muted-foreground)",label:"transitive"}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dw,{className:"size-3 text-[color:var(--sev-high)]"})," flagged"]}),(0,eT.jsx)("span",{className:"ml-auto hidden sm:inline",children:"Click a node to inspect its edges"})]}),(0,eT.jsx)("div",{className:"overflow-auto bg-[image:radial-gradient(var(--border)_1px,transparent_1px)] [background-size:16px_16px]",children:(0,eT.jsxs)("svg",{width:c,height:u,viewBox:`0 0 ${c} ${u}`,className:"min-w-full",role:"img","aria-label":"Dependency graph",children:[(0,eT.jsx)("g",{children:m.map((e,t)=>{let n=null!==a&&e.from.depth!==a&&e.to.depth!==a,r=e.from.x+176,i=e.from.y+15,s=e.to.x,o=e.to.y+15,l=(r+s)/2,d=!!p&&(e.from.id===p||e.to.id===p);return(0,eT.jsx)("path",{d:`M ${r} ${i} C ${l} ${i}, ${l} ${o}, ${s} ${o}`,fill:"none",stroke:d?"var(--chart-1)":"var(--border)",strokeWidth:d?1.6:1,opacity:n?.15:p&&!d?.25:.7},t)})}),(0,eT.jsx)("g",{children:l.map(e=>{var t;let r=(t=e.id,p?t===p?"active":f?.deps.has(t)||f?.dependents.has(t)?"linked":"dim":"normal"),s=null!==a&&e.depth!==a,o=dE(e);return(0,eT.jsxs)("g",{transform:`translate(${e.x}, ${e.y})`,opacity:s?.2:"dim"===r?.3:1,className:"cursor-pointer",onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null),onClick:()=>n(t=>t===e.id?null:e.id),children:[(0,eT.jsx)("rect",{width:176,height:30,rx:4,fill:"var(--card)",stroke:"active"===r?o:"var(--border)",strokeWidth:"active"===r?2:1}),(0,eT.jsx)("rect",{width:4,height:30,rx:2,fill:o}),(0,eT.jsx)("text",{x:14,y:15,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:11,children:e.id.length>18?e.id.slice(0,17)+"…":e.id}),e.flagged&&(0,eT.jsx)("circle",{cx:164,cy:15,r:3,fill:`var(--chart-${dC(e.severity??"info")})`})]},e.id)})})]})})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsx)("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Graph stats"}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsx)(dP,{icon:eq,value:e.nodes.length,label:"modules"}),(0,eT.jsx)(dP,{icon:te,value:x,label:"direct"}),(0,eT.jsx)(dP,{icon:s4,value:v,label:"dev"}),(0,eT.jsx)(dP,{icon:dw,value:y,label:"flagged"})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:["install size ≈ ",(0,eT.jsxs)("span",{className:"font-mono text-foreground",children:[(b/1024).toFixed(1)," MB"]})," ·"," ",o+1," levels deep"]})]}),h?(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"size-2.5 rounded-full",style:{background:dE(h)},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:h.id})]}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.version}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.type}),(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:["depth ",h.depth]}),null!=h.sizeKb&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.sizeKb>=1024?`${(h.sizeKb/1024).toFixed(1)} MB`:`${h.sizeKb} KB`})]}),h.flagged&&h.severity&&(0,eT.jsx)("div",{className:"mt-3",children:(0,eT.jsxs)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",oV(h.severity).bg,oV(h.severity).text),children:["has ",oV(h.severity).label," finding"]})}),(0,eT.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Depends on (",h.dependencies.length,")"]}),0===h.dependencies.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"No further dependencies (leaf)."}):(0,eT.jsx)("div",{className:"flex flex-wrap gap-1",children:h.dependencies.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>d.has(e)&&n(e),className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px]",d.has(e)?"bg-secondary text-foreground hover:bg-secondary/70":"bg-secondary/40 text-muted-foreground"),children:e},e))})]}),(0,eT.jsxs)("div",{className:"mt-3 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Required by (",g.length,")"]}),0===g.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"Root-level / not required by another module."}):(0,eT.jsx)("div",{className:"flex flex-wrap gap-1",children:g.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>n(e.id),className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground hover:bg-secondary/70",children:e.id},e.id))})]})]}):(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-4 text-sm text-muted-foreground",children:[(0,eT.jsx)(eq,{className:"size-5 text-muted-foreground"}),(0,eT.jsx)("p",{className:"text-pretty",children:"Select a module in the graph to trace what it depends on and which packages require it."})]})]})]})}function dT({color:e,label:t}){return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"size-2.5 rounded-full",style:{background:e},"aria-hidden":!0}),t]})}function dP({icon:e,value:t,label:n}){return(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(e,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:t})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n})]})}let dz={vulnerability:"Vulnerable",outdated:"Outdated",deprecated:"Deprecated",unused:"Unused",missing:"Missing",license:"License"};function dO({dep:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oJ(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oJ(e)))},className:"flex w-full cursor-pointer flex-col gap-2 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40 sm:flex-row sm:items-start sm:gap-4",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)(eq,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.current}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dz[e.kind]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.type})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[e.cves?.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:e},e)),e.license&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:e.license}),e.usedIn&&e.usedIn.length>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:["used in ",(0,eT.jsx)(lR,{path:e.usedIn[0]})]})]})]}),(0,eT.jsx)(lM,{issue:oJ(e),variant:"dot",className:"mt-0.5"})]}),e.fixedIn&&(0,eT.jsxs)("div",{className:"inline-flex shrink-0 items-center gap-1 rounded-sm border border-[color:var(--sev-ok)]/40 bg-[color:var(--sev-ok)]/10 px-2.5 py-1 font-mono text-xs text-[color:var(--sev-ok)]",children:[e.current," ",(0,eT.jsx)(s2,{className:"size-3"})," ",e.fixedIn]})]})}function dM({deps:e}){let[t,n]=(0,eP.useState)("findings"),r=[{key:"findings",label:"Findings",icon:oT,count:e.findings.length},{key:"graph",label:"Dependency graph",icon:dI,count:e.graph?.nodes.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:r.map(r=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(r.key),disabled:"graph"===r.key&&!e.graph,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors disabled:opacity-40",t===r.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(r.icon,{className:"size-4"}),r.label,null!=r.count&&(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:r.count})]},r.key))}),"graph"===t&&e.graph?(0,eT.jsx)(dA,{graph:e.graph}):(0,eT.jsx)(dR,{deps:e})]})}function dR({deps:e}){let[t,n]=(0,eP.useState)("all"),r=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),i=(0,eP.useMemo)(()=>"all"===t?r:r.filter(e=>e.kind===t),[r,t]),a=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:dz[e],count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.type,(t.get(n.type)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),o=["critical","high","medium","low","info"].map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})),l=e.findings.filter(e=>e.fixedIn).length,d=e.findings.filter(e=>"vulnerability"===e.kind).length,c=[{key:"all",label:"All",count:e.findings.length},...a.map(e=>({key:e.key,label:e.label,count:e.count}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Inventory",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total deps"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.direct}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"direct"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.dev}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"dev"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:l}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"upgradable"})]})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:[(0,eT.jsx)("span",{className:"font-mono text-foreground",children:d})," with known advisories ·"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.transitive})," transitive"]})]}),(0,eT.jsx)(oS,{title:"By severity",children:(0,eT.jsx)(o$,{segments:o})}),(0,eT.jsx)(oS,{title:"By issue type",children:(0,eT.jsx)(oI,{rows:a,activeKey:"all"===t?null:t,onSelect:e=>n(t=>t===e?"all":e)})}),(0,eT.jsx)(oS,{title:"By dependency type",children:(0,eT.jsx)(oI,{rows:s})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:c.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(te,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Dependency findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:i.length}),(0,eT.jsxs)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:["from ",(0,eT.jsx)(lR,{path:e.manifestPath})]})]}),0===i.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No dependency issues in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:i.map(e=>(0,eT.jsx)(dO,{dep:e},e.id))})]})]})}let dD=eL("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]),dL=eL("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),dU=eL("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),dZ=eL("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]),dF=eL("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),dB=eL("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),dV=eL("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),dq={postgres:"PostgreSQL",mysql:"MySQL",mongodb:"MongoDB",sqlite:"SQLite",redis:"Redis",other:"Other"};function dW({tables:e,connections:t}){let[n,r]=(0,eP.useState)(null),[i,a]=(0,eP.useState)(null),s=(0,eP.useMemo)(()=>{let n=new Map;for(let r of e){let e=t.find(e=>e.id===r.connectionId);n.set(r.name,e?.engine??"other")}return n},[e,t]),o=(0,eP.useMemo)(()=>{let t=new Set(e.map(e=>e.name)),n=[];for(let r of e)for(let e of r.columns){if(!e.references)continue;let i=function(e){let t=e.lastIndexOf(".");return t<=0?null:{table:e.slice(0,t),column:e.slice(t+1)}}(e.references);i&&t.has(i.table)&&i.table!==r.name&&n.push({id:`${r.name}.${e.name}->${i.table}`,from:r.name,to:i.table,fromColumn:e.name,toColumn:i.column})}return n},[e]),{positioned:l,byName:d,width:c,height:u}=(0,eP.useMemo)(()=>{let t=new Set;for(let e of o)t.add(e.from),t.add(e.to);let n=[...e].sort((e,n)=>{let r=+!t.has(e.name),i=+!t.has(n.name);return r!==i?r-i:n.columns.length-e.columns.length}),r=Math.max(1,Math.ceil(Math.sqrt(n.length))),i=e=>34+22*Math.min(e.columns.length,7),a=Math.max(56,...n.map(i))+48,s=n.map((e,t)=>{let n=Math.floor(t/r),s=e.columns.slice(0,7);return{table:e,rows:s,x:28+t%r*280,y:28+n*a,w:210,h:i(e)}}),l=new Map(s.map(e=>[e.table.name,e])),d=Math.ceil(n.length/r);return{positioned:s,byName:l,width:56+280*r-70,height:56+d*a-48}},[e,o]),m=n??i,p=(0,eP.useMemo)(()=>{if(!m)return null;let e=new Set([m]);for(let t of o)t.from===m&&e.add(t.to),t.to===m&&e.add(t.from);return e},[m,o]),f=n?d.get(n)?.table:null,h=n?o.filter(e=>e.from===n):[],g=n?o.filter(e=>e.to===n):[];return 0===e.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5"}),"No schema discovered, so there are no relationships to map yet."]}):0===o.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5"}),(0,eT.jsxs)("p",{className:"text-pretty",children:[e.length," ",1===e.length?"table was":"tables were"," found, but no foreign-key relationships were detected between them. Add explicit references in your schema (e.g. Drizzle"," ",(0,eT.jsx)("span",{className:"font-mono",children:"references()"})," or Prisma ",(0,eT.jsx)("span",{className:"font-mono",children:"@relation"}),") to see an ER map here."]})]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)(s8,{className:"min-w-0 gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dU,{className:"size-3 text-[color:var(--sev-ok)]"})," primary key"]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"})," foreign key"]}),(0,eT.jsx)("span",{className:"ml-auto hidden sm:inline",children:"Click a table to trace its relationships"})]}),(0,eT.jsx)("div",{className:"overflow-auto bg-[image:radial-gradient(var(--border)_1px,transparent_1px)] [background-size:16px_16px]",children:(0,eT.jsxs)("svg",{width:c,height:u,viewBox:`0 0 ${c} ${u}`,className:"min-w-full",role:"img","aria-label":"Database relationship diagram",children:[(0,eT.jsx)("g",{children:o.map(e=>{let t=function(e){let t=d.get(e.from),n=d.get(e.to);if(!t||!n)return null;let r=t.x+t.w/2,i=n.x+n.w/2,a=t.rows.findIndex(t=>t.name===e.fromColumn),s=a>=0?t.y+34+22*a+11:t.y+t.h/2,o=n.y+17,l=i>=r,c=l?t.x+t.w:t.x,u=i>=r?n.x:n.x+n.w,p=.5*Math.abs(u-c)||30;return{d:`M ${c} ${s} C ${l?c+p:c-p} ${s}, ${l?u-p:u+p} ${o}, ${u} ${o}`,activeEdge:m===e.from||m===e.to}}(e);if(!t)return null;let n=m&&!t.activeEdge;return(0,eT.jsx)("path",{d:t.d,fill:"none",stroke:t.activeEdge?"var(--chart-1)":"var(--muted-foreground)",strokeWidth:t.activeEdge?1.8:1,opacity:n?.15:.55,markerEnd:t.activeEdge?"url(#er-arrow-active)":"url(#er-arrow)"},e.id)})}),(0,eT.jsxs)("defs",{children:[(0,eT.jsx)("marker",{id:"er-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:(0,eT.jsx)("path",{d:"M0,0 L6,3 L0,6 Z",fill:"var(--muted-foreground)"})}),(0,eT.jsx)("marker",{id:"er-arrow-active",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:(0,eT.jsx)("path",{d:"M0,0 L6,3 L0,6 Z",fill:"var(--chart-1)"})})]}),(0,eT.jsx)("g",{children:l.map(e=>{var t;let n=(t=e.table.name,!!(m&&p&&!p.has(t))),i=m===e.table.name,o=s.get(e.table.name)??"other",l=e.table.columns.length-e.rows.length;return(0,eT.jsxs)("g",{transform:`translate(${e.x}, ${e.y})`,opacity:n?.3:1,className:"cursor-pointer",onMouseEnter:()=>a(e.table.name),onMouseLeave:()=>a(null),onClick:()=>r(t=>t===e.table.name?null:e.table.name),children:[(0,eT.jsx)("rect",{width:e.w,height:e.h,rx:6,fill:"var(--card)",stroke:i?"var(--chart-1)":"var(--border)",strokeWidth:i?2:1}),(0,eT.jsx)("rect",{width:e.w,height:34,rx:6,fill:"var(--secondary)"}),(0,eT.jsx)("rect",{y:28,width:e.w,height:6,fill:"var(--secondary)"}),(0,eT.jsx)("text",{x:12,y:17,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:12,fontWeight:600,children:e.table.name.length>22?e.table.name.slice(0,21)+"…":e.table.name}),(0,eT.jsx)("text",{x:e.w-10,y:17,textAnchor:"end",dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:8,children:dq[o].toUpperCase()}),e.rows.map((t,n)=>{let r=t.flags.includes("pk"),i=t.flags.includes("fk")||!!t.references;return(0,eT.jsxs)("g",{transform:`translate(0, ${34+22*n})`,children:[n>0&&(0,eT.jsx)("line",{x1:0,y1:0,x2:e.w,y2:0,stroke:"var(--border)",strokeWidth:.5,opacity:.5}),r&&(0,eT.jsx)("circle",{cx:12,cy:11,r:3,fill:"var(--sev-ok)"}),!r&&i&&(0,eT.jsx)("circle",{cx:12,cy:11,r:3,fill:"var(--chart-1)"}),!r&&!i&&(0,eT.jsx)("circle",{cx:12,cy:11,r:2,fill:"var(--muted-foreground)",opacity:.4}),(0,eT.jsx)("text",{x:24,y:11,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:10,children:t.name.length>16?t.name.slice(0,15)+"…":t.name}),(0,eT.jsx)("text",{x:e.w-10,y:11,textAnchor:"end",dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:9,children:t.type.length>12?t.type.slice(0,11)+"…":t.type})]},t.name)}),l>0&&(0,eT.jsx)("text",{x:24,y:34+22*e.rows.length-11+22,dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:9,children:`+${l} more`})]},e.table.name)})})]})})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsx)("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Schema map"}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dV,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:e.length})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"tables"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dp,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:o.length})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"relationships"})]})]})]}),f?(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dV,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:f.name})]}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:f.kind}),(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:[f.columns.length," cols"]}),f.rowCount>0&&(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:[f.rowCount.toLocaleString()," rows"]})]}),(0,eT.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["References (",h.length,")"]}),0===h.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"This table has no outgoing foreign keys."}):(0,eT.jsx)("div",{className:"flex flex-col gap-1",children:h.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.to),className:"flex items-center gap-1.5 rounded-sm bg-secondary/60 px-2 py-1 text-left font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.fromColumn}),(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"}),(0,eT.jsx)("span",{children:e.to}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:[".",e.toColumn]})]},e.id))})]}),(0,eT.jsxs)("div",{className:"mt-3 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Referenced by (",g.length,")"]}),0===g.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"No other table references this one."}):(0,eT.jsx)("div",{className:"flex flex-col gap-1",children:g.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.from),className:"flex items-center gap-1.5 rounded-sm bg-secondary/60 px-2 py-1 text-left font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{children:e.from}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:[".",e.fromColumn]}),(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.toColumn})]},e.id))})]}),f.filePath&&(0,eT.jsx)("div",{className:"mt-3 border-t border-border pt-3 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:f.filePath})})]}):(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-4 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5 text-muted-foreground"}),(0,eT.jsx)("p",{className:"text-pretty",children:"Select a table in the diagram to trace what it references and which tables point back to it."})]})]})]})}let dH={"n+1":"N+1 query","missing-index":"Missing index","no-pooling":"No pooling",injection:"Injection",unparameterized:"Unparameterized","schema-drift":"Schema drift","no-migration":"No migration","unbounded-query":"Unbounded query","no-ssl":"No SSL","connection-leak":"Connection leak","missing-ttl":"Missing TTL","full-scan":"Full scan","no-validation":"No validation"},dG={postgres:"PostgreSQL",mysql:"MySQL",mongodb:"MongoDB",sqlite:"SQLite",redis:"Redis",other:"Other"},dK={dependency:"Dependency",env:"Env var","connection-string":"Connection string","schema-file":"Schema file",config:"Config"};function dJ({engine:e}){return(0,eT.jsx)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dG[e]})}function dY({active:e,onClick:t,icon:n,label:r,count:i}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[n,r,null!=i&&(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:i})]})}function dX({conn:e}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border px-3 py-2.5 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eW,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.name}),(0,eT.jsx)(dJ,{engine:e.engine})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 pl-6 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"truncate",children:e.client}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[e.ssl?(0,eT.jsx)(dm,{className:"size-3 text-[color:var(--sev-ok)]"}):(0,eT.jsx)(dD,{className:"size-3 text-[color:var(--sev-high)]"}),e.ssl?"TLS":"no TLS"]}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.pooled?"text-muted-foreground":"text-[color:var(--sev-medium)]"),children:e.pooled?"pooled":"unpooled"})]})]})}function dQ({label:e,value:t,mono:n=!0}){return(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-3 py-1.5",children:[(0,eT.jsx)("span",{className:"shrink-0 text-[11px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)("min-w-0 truncate text-right text-xs text-foreground",n&&"font-mono"),children:t})]})}function d0({conn:e}){return(0,eT.jsxs)(s8,{className:"gap-0 p-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border p-4",children:[(0,eT.jsx)("span",{className:"inline-flex size-8 shrink-0 items-center justify-center rounded-sm bg-secondary",children:(0,eT.jsx)(eW,{className:"size-4 text-foreground"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)(dJ,{engine:e.engine})]}),(0,eT.jsx)("p",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e.client})]}),(0,eT.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:e.ssl?(0,eT.jsxs)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(dm,{className:"mr-1 size-3"}),"TLS"]}):(0,eT.jsxs)(nS,{className:"border-0 bg-[color:var(--sev-high)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:[(0,eT.jsx)(dD,{className:"mr-1 size-3"}),"No TLS"]})})]}),(0,eT.jsxs)("div",{className:"flex flex-col px-4 py-2",children:[(0,eT.jsx)(dQ,{label:"Host",value:e.host}),e.scheme&&(0,eT.jsx)(dQ,{label:"Scheme",value:e.scheme}),e.envVar&&(0,eT.jsx)(dQ,{label:"Env var",value:e.envVar}),(0,eT.jsx)(dQ,{label:"Detected via",value:e.detectedVia?dK[e.detectedVia]:"—",mono:!1}),e.schemaSource&&(0,eT.jsx)(dQ,{label:"Schema",value:e.schemaSource,mono:!1}),(0,eT.jsx)(dQ,{label:"Pooling",value:e.pooled?"Pooled":"Direct / unpooled",mono:!1}),(0,eT.jsx)(dQ,{label:"mongodb"===e.engine?"Collections":"Tables",value:e.collections.toLocaleString()})]}),(0,eT.jsx)("div",{className:"border-t border-border px-4 py-2 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath})})]})}function d1({f:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsx)("div",{role:"button",tabIndex:0,onClick:()=>t(o0(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o0(e)))},className:"flex w-full cursor-pointer flex-col gap-2 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)(eW,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)(dJ,{engine:e.engine}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dH[e.kind]}),e.target&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.target})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsx)("div",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsx)(lM,{issue:o0(e),variant:"dot",className:"mt-0.5"})]})})}function d2({flags:e}){return(0,eT.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1",children:[e.includes("pk")&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(dU,{className:"size-3"}),"PK"]}),e.includes("fk")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Link"}),e.includes("unique")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Unique"}),e.includes("index")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Index"}),e.includes("nullable")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Nullable"}),e.includes("default")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Default"})]})}function d4({table:e,expanded:t,onToggle:n}){return(0,eT.jsxs)("div",{className:"border-t border-border first:border-t-0",children:[(0,eT.jsx)("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},className:"flex w-full cursor-pointer items-center justify-between gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)("div",{className:"mt-0.5 inline-flex size-4 shrink-0 items-center justify-center",children:(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind})]}),(0,eT.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{children:[e.columns.length," columns"]}),e.rowCount>0&&(0,eT.jsxs)("span",{children:[e.rowCount.toLocaleString()," rows"]}),e.sizeKb?(0,eT.jsxs)("span",{children:[(e.sizeKb/1024).toFixed(1)," MB"]}):null,e.indexes.length>0&&(0,eT.jsxs)("span",{children:[e.indexes.length," indexes"]})]})]})]})}),t&&(0,eT.jsxs)("div",{className:"border-t border-border/50 bg-secondary/20 p-4",children:[(0,eT.jsx)("div",{className:"flex flex-col gap-3",children:e.columns.map(e=>(0,eT.jsx)("div",{className:"flex items-start justify-between gap-2 font-mono text-xs",children:(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"text-muted-foreground/70",children:e.type}),e.references&&(0,eT.jsx)("span",{className:"text-muted-foreground/70",children:`→ ${e.references}`})]}),(0,eT.jsx)(d2,{flags:e.flags})]})},e.name))}),e.indexes.length>0&&(0,eT.jsxs)("div",{className:"mt-4 border-t border-border/50 pt-3",children:[(0,eT.jsx)("p",{className:"mb-2 font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:"Indexes"}),(0,eT.jsx)("div",{className:"flex flex-col gap-1.5",children:e.indexes.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[(0,eT.jsx)(dd,{className:"size-3 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-foreground",children:e.name}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:["(",e.columns.join(", "),")"]}),e.unique&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"unique"})]},e.name))})]}),e.filePath&&(0,eT.jsx)("div",{className:"mt-3 border-t border-border/50 pt-3 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath})})]})]})}function d5({q:e}){let t=e.estMs>=1500?"var(--sev-critical)":e.estMs>=1e3?"var(--sev-high)":e.estMs>=300?"var(--sev-medium)":"var(--sev-ok)";return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsx)("span",{className:"w-16 shrink-0 font-mono text-[11px] uppercase text-muted-foreground",children:e.operation}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.target}),(0,eT.jsx)(dJ,{engine:e.engine}),e.fullScan&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-high)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:[(0,eT.jsx)(dw,{className:"size-3"})," scan"]})]}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-1 text-[11px] text-muted-foreground",children:e.note}),(0,eT.jsx)("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 font-mono text-xs tabular-nums",style:{color:t},children:[(0,eT.jsx)(dL,{className:"size-3"}),e.estMs>=1e3?`${(e.estMs/1e3).toFixed(1)}s`:`${e.estMs}ms`]})]})}let d6=["critical","high","medium","low","info"];function d3({database:e}){let t=e.tables??[],n=e.connections.length>0,[r,i]=(0,eP.useState)(n?"connections":"findings"),[a,s]=(0,eP.useState)("all"),[o,l]=(0,eP.useState)(new Set),d=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),c=(0,eP.useMemo)(()=>"all"===a?d:d.filter(e=>e.severity===a),[d,a]),u=(0,eP.useMemo)(()=>[...e.queries].sort((e,t)=>t.estMs-e.estMs),[e.queries]),m=(0,eP.useMemo)(()=>[...new Set(e.connections.map(e=>e.engine))].map((t,n)=>({label:dG[t],value:Math.max(1,e.connections.filter(e=>e.engine===t).length),color:`var(--chart-${n%5+1})`})),[e.connections]),p=d6.map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})).filter(e=>e.value>0),f=[{key:"all",label:"All",count:d.length},...d6.map(e=>({key:e,label:oV(e).label,count:d.filter(t=>t.severity===e).length})).filter(e=>e.count>0)],h=(0,eP.useMemo)(()=>{let e=new Set(t.map(e=>e.name)),n=0;for(let r of t)for(let t of r.columns){if(!t.references)continue;let i=t.references.lastIndexOf("."),a=i>0?t.references.slice(0,i):"";a&&a!==r.name&&e.has(a)&&n++}return n},[t]),g=(0,eP.useMemo)(()=>{let e=new Map;for(let n of t){let t=e.get(n.connectionId)??[];t.push(n),e.set(n.connectionId,t)}return e},[t]);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Datastores",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3 pb-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.connections}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"connections"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.collections}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"tables / collections"})]})]}),(0,eT.jsxs)("div",{className:"-mx-3 border-t border-border",children:[e.connections.map(e=>(0,eT.jsx)(dX,{conn:e},e.id)),!n&&(0,eT.jsx)("p",{className:"px-3 py-3 text-[11px] text-muted-foreground",children:"No datastore detected."})]})]}),m.length>0&&(0,eT.jsx)(oS,{title:"By engine",children:(0,eT.jsx)(o$,{segments:m})}),p.length>0&&(0,eT.jsx)(oS,{title:"Findings by severity",children:(0,eT.jsx)(o$,{segments:p})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)(dY,{active:"connections"===r,onClick:()=>i("connections"),icon:(0,eT.jsx)(dZ,{className:"size-4"}),label:"Connections",count:e.connections.length}),(0,eT.jsx)(dY,{active:"schema"===r,onClick:()=>i("schema"),icon:(0,eT.jsx)(s9,{className:"size-4"}),label:"Schema",count:t.length}),(0,eT.jsx)(dY,{active:"relationships"===r,onClick:()=>i("relationships"),icon:(0,eT.jsx)(dB,{className:"size-4"}),label:"Relationships",count:h}),(0,eT.jsx)(dY,{active:"queries"===r,onClick:()=>i("queries"),icon:(0,eT.jsx)(e0,{className:"size-4"}),label:"Queries",count:e.queries.length}),(0,eT.jsx)(dY,{active:"findings"===r,onClick:()=>i("findings"),icon:(0,eT.jsx)(dw,{className:"size-4"}),label:"Findings",count:e.findings.length})]}),"connections"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dF,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Detected datastores"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.connections.length})]}),n?(0,eT.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:e.connections.map(e=>(0,eT.jsx)(d0,{conn:e},e.id))}):(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-5"}),"No database connection detected. Add a connection string (e.g. DATABASE_URL or MONGODB_URI) or a database client dependency."]})]}),"schema"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s9,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Schema explorer"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[t.length," ",1===t.length?"table":"tables"]})]}),0===t.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(lH,{className:"size-5"}),"No schema discovered. Add a Prisma/Drizzle schema, Mongoose models, or provide a reachable connection string for live introspection."]}):(0,eT.jsx)("div",{className:"flex flex-col gap-4",children:[...g.entries()].map(([t,n])=>{let r=e.connections.find(e=>e.id===t);return(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[r&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)(te,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xs text-foreground",children:r.name}),(0,eT.jsx)(dJ,{engine:r.engine}),(0,eT.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[n.length," ","mongodb"===r.engine?"collections":"tables"]})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:n.map(e=>(0,eT.jsx)(d4,{table:e,expanded:o.has(`${t}:${e.name}`),onToggle:()=>{var n;return n=`${t}:${e.name}`,void l(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})}},`${t}:${e.name}`))})]},t)})})]}),"relationships"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dB,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Relationship map"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[h," ",1===h?"relation":"relations"]})]}),(0,eT.jsx)(dW,{tables:t,connections:e.connections})]}),"queries"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e0,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Slowest queries"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.counts.slowQueries," slow"]})]}),0===u.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No notable or slow queries detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:u.map(e=>(0,eT.jsx)(d5,{q:e},e.id))})]}),"findings"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:f.map(e=>(0,eT.jsx)(dY,{active:a===e.key,onClick:()=>s(e.key),label:e.label,count:e.count},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eW,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Database findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:c.length})]}),0===c.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No database issues in this severity."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:c.map(e=>(0,eT.jsx)(d1,{f:e},e.id))})]})]})]})}let d9=eL("circle-slash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);function d8(e){switch(e){case"GET":case"HEAD":case"OPTIONS":default:return{text:"text-muted-foreground",bg:"bg-secondary",border:"border-border"};case"POST":return{text:"text-primary-foreground",bg:"bg-primary",border:"border-primary"};case"PUT":case"PATCH":return{text:"text-foreground",bg:"bg-accent",border:"border-foreground/40"};case"DELETE":return{text:"text-foreground",bg:"bg-background",border:"border-foreground/60"}}}let d7=["POST","PUT","PATCH","DELETE"];function ce({api:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)(""),a=(0,eP.useMemo)(()=>[...e.endpoints].sort((e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)),[e.endpoints]),s=(0,eP.useMemo)(()=>{let e=a;"mutations"===t?e=e.filter(e=>d7.includes(e.method)):"public"===t?e=e.filter(e=>!e.flags.auth&&d7.includes(e.method)):"issues"===t&&(e=e.filter(e=>e.findings.length>0));let n=r.trim().toLowerCase();return n&&(e=e.filter(e=>e.path.toLowerCase().includes(n)||e.method.toLowerCase().includes(n))),e},[a,t,r]),o=(0,eP.useMemo)(()=>{let e=new Map;for(let t of s){let n=t.path.replace(/^\//,"").split("/")[0]||"(root)";e.has(n)||e.set(n,[]),e.get(n).push(t)}return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[s]);if(!e.present)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(dB,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No API endpoints detected"}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:"Projectlens maps route handlers and server actions across Next.js, Express, Hono, Fastify, SvelteKit and Nuxt. Add a server route to see your API surface here."})]})]});let l=[{key:"all",label:"All",count:e.counts.endpoints},{key:"mutations",label:"Mutations",count:e.counts.mutations},{key:"public",label:"Public mutations",count:e.endpoints.filter(e=>!e.flags.auth&&d7.includes(e.method)).length},{key:"issues",label:"With issues",count:e.endpoints.filter(e=>e.findings.length>0).length}],d=e.counts.endpoints>0?Math.round(e.counts.protected/e.counts.endpoints*100):0,c=e.counts.endpoints>0?Math.round(e.counts.validated/e.counts.endpoints*100):0;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:l.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsx)("input",{type:"search",value:r,onChange:e=>i(e.target.value),placeholder:"Filter routes…",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring sm:w-44","aria-label":"Filter routes"})]}),0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(d9,{className:"size-5 text-muted-foreground"}),"No endpoints match this filter."]}):o.map(([e,t])=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsxs)("span",{className:"font-mono text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["/",e]}),(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:[t.length," ",1===t.length?"route":"routes"]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-2",children:t.map(e=>(0,eT.jsx)(ct,{endpoint:e},e.id))})]},e))]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4",children:[(0,eT.jsx)(oS,{title:"Surface",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Endpoints"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.endpoints})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Mutations"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.mutations})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Dynamic routes"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.dynamic})]}),e.style&&(0,eT.jsx)("div",{className:"border-t border-border pt-2 text-xs leading-relaxed text-muted-foreground",children:e.style})]})}),(0,eT.jsx)(oS,{title:"Coverage",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsx)(ci,{label:"Protected",pct:d,count:e.counts.protected,total:e.counts.endpoints}),(0,eT.jsx)(ci,{label:"Validated",pct:c,count:e.counts.validated,total:e.counts.endpoints})]})}),e.methodCounts.length>0&&(0,eT.jsxs)(oS,{title:"By method",children:[(0,eT.jsx)(o$,{segments:e.methodCounts.map(e=>({label:e.method,value:e.count,color:function(e){switch(e){case"GET":case"HEAD":case"OPTIONS":return"var(--chart-4)";case"POST":return"var(--chart-1)";case"PUT":case"PATCH":return"var(--chart-2)";case"DELETE":return"var(--chart-3)";default:return"var(--chart-5)"}}(e.method)}))}),(0,eT.jsx)("div",{className:"mt-3 flex flex-col gap-1.5",children:e.methodCounts.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("font-mono font-semibold",d8(e.method).text),children:e.method}),(0,eT.jsx)("span",{className:"font-mono text-muted-foreground",children:e.count})]},e.method))})]}),(0,eT.jsx)(oS,{title:"Findings",children:(0,eT.jsx)("div",{className:"flex items-center gap-2",children:0===e.counts.findings?(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(eV,{className:"size-4 text-[color:var(--sev-ok)]"}),(0,eT.jsx)("span",{className:"text-sm text-muted-foreground",children:"No API issues found"})]}):(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(eB,{className:"size-4 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("span",{className:"text-sm text-foreground",children:[e.counts.findings," ",1===e.counts.findings?"issue":"issues"," across the surface"]})]})})})]})]})}function ct({endpoint:e}){let[t,n]=(0,eP.useState)(!1),r=d8(e.method),i=e.findings.length>0,a=i?e.findings.reduce((e,t)=>ca(t.severity)>ca(e)?t.severity:e,e.findings[0].severity):null;return(0,eT.jsxs)(s8,{className:(0,ny.cn)("overflow-hidden transition-colors",t&&"ring-1 ring-border"),children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("shrink-0 rounded-sm border px-2 py-0.5 font-mono text-[11px] font-semibold uppercase",r.bg,r.border,r.text),children:e.method}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm text-foreground",children:e.path}),(0,eT.jsxs)("div",{className:"hidden items-center gap-1.5 sm:flex",children:[(0,eT.jsx)(cn,{ok:e.flags.auth,okIcon:dm,noIcon:dD,okLabel:"auth",noLabel:"public"}),(0,eT.jsx)(cn,{ok:e.flags.validation,okIcon:da,noIcon:d9,okLabel:"valid",noLabel:"no schema",muted:!d7.includes(e.method)}),e.flags.database&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3"}),"db"]})]}),i&&a&&(0,eT.jsx)("span",{className:(0,ny.cn)("shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase",oV(a).bg,oV(a).text),children:e.findings.length}),(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 shrink-0 text-muted-foreground transition-transform",t&&"rotate-90")})]}),t&&(0,eT.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-background/40 p-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase",children:function(e){switch(e){case"next-app":return"App Route";case"next-pages":return"Pages API";case"next-action":return"Server Action";case"sveltekit":return"SvelteKit";case"nuxt":return"Nuxt";default:return e}}(e.kind)}),e.dynamic&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px]",children:"dynamic"}),e.handler&&(0,eT.jsxs)("span",{className:"font-mono text-[10px]",children:["handler: ",e.handler]})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border font-mono text-xs sm:grid-cols-3",children:[(0,eT.jsx)(cr,{label:"auth",on:e.flags.auth}),(0,eT.jsx)(cr,{label:"validation",on:e.flags.validation}),(0,eT.jsx)(cr,{label:"error handling",on:e.flags.errorHandling}),(0,eT.jsx)(cr,{label:"reads input",on:e.flags.inputs,neutral:!0}),(0,eT.jsx)(cr,{label:"database",on:e.flags.database,neutral:!0}),(0,eT.jsx)(cr,{label:"env access",on:e.flags.env,neutral:!0})]}),i&&(0,eT.jsx)("ul",{className:"flex flex-col gap-2",children:e.findings.map(e=>{let t=oV(e.severity);return(0,eT.jsxs)("li",{className:"rounded-sm border border-border bg-card p-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("size-1.5 rounded-full",t.dot),"aria-hidden":!0}),(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)("span",{className:(0,ny.cn)("ml-auto font-mono text-[10px] uppercase",t.text),children:t.label})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsxs)("p",{className:"mt-1.5 text-pretty text-xs leading-relaxed text-foreground/80",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"fix:"})," ",e.recommendation]})]},e.id)})})]})]})}function cn({ok:e,okIcon:t,noIcon:n,okLabel:r,noLabel:i,muted:a}){return a?null:(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 font-mono text-[10px]",e?"border-border bg-secondary text-muted-foreground":"border-foreground/40 bg-background font-semibold text-foreground"),children:[(0,eT.jsx)(e?t:n,{className:"size-3"}),e?r:i]})}function cr({label:e,on:t,neutral:n}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between bg-card px-2.5 py-1.5",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)(n?"text-foreground/70":t?"font-semibold text-foreground":"text-muted-foreground"),children:t?"yes":"no"})]})}function ci({label:e,pct:t,count:n,total:r}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:"font-mono text-foreground",children:[n,"/",r," · ",t,"%"]})]}),(0,eT.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-foreground",style:{width:`${t}%`},"aria-hidden":!0})})]})}function ca(e){return({critical:5,high:4,medium:3,low:2,info:1})[e]??0}let cs=eL("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),co=eL("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),cl=eL("fingerprint-pattern",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]),cd={"two-factor":"Two-Factor",passwordless:"Passwordless",social:"Social",authorization:"Authorization",session:"Session",api:"API",enterprise:"Enterprise",integration:"Integration",utility:"Utility",other:"Other"},cc={ok:"var(--sev-ok)",warn:"var(--sev-medium)",fail:"var(--sev-critical)",info:"var(--muted-foreground)"};function cu({method:e}){var t;let n="credential"===(t=e.kind)?eH:"social"===t?eG:cl;return(0,eT.jsx)(s8,{className:"gap-0 p-4",children:(0,eT.jsxs)("div",{className:"flex items-start gap-3",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-9 shrink-0 items-center justify-center rounded-sm border",e.enabled?"border-[color:var(--sev-ok)]/40 text-[color:var(--sev-ok)]":"border-border text-muted-foreground"),children:(0,eT.jsx)(n,{className:"size-4"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:e.label}),(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",e.enabled?"bg-[color:var(--sev-ok)]/12 text-[color:var(--sev-ok)]":"bg-secondary text-muted-foreground"),children:e.enabled?"On":"Off"})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.providers&&e.providers.length>0&&(0,eT.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:e.providers.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-1.5 py-0.5 font-mono text-[10px] capitalize text-muted-foreground",children:e},e))})]})]})})}function cm({plugin:e,onOpen:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-start gap-3 rounded-sm border border-border bg-card p-3 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(cs,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:cd[e.category]}),e.clientMissing&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-medium)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3"}),"client missing"]})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,eT.jsxs)("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1",e.detectedServer?"text-[color:var(--sev-ok)]":"text-muted-foreground/50"),children:[(0,eT.jsx)(dF,{className:"size-3"}),"server"]}),e.needsClient&&(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1",e.detectedClient?"text-[color:var(--sev-ok)]":"text-[color:var(--sev-medium)]"),children:[(0,eT.jsx)(co,{className:"size-3"}),"client"]})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cp({item:e}){let t=cc[e.status];return(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"size-2 shrink-0 rounded-full",style:{background:t},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"text-sm text-foreground",children:e.label})]}),e.detail&&(0,eT.jsx)("p",{className:"mt-1 pl-4 text-xs text-muted-foreground",children:e.detail}),e.recommendation&&(0,eT.jsx)("p",{className:"mt-1 pl-4 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.recommendation})]}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-xs",style:{color:t},children:e.value})]})}function cf({f:e,onOpen:t}){let n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-4 shrink-0",style:{color:`var(--sev-${e.severity})`}}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function ch({auth:e}){let[t,n]=(0,eP.useState)(null),[r,i]=(0,eP.useState)(null),a=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.plugins)t.set(n.category,(t.get(n.category)??0)+1);return[...t.entries()].map(([e,t],n)=>({label:cd[e],value:t,color:`var(--chart-${n%5+1})`}))},[e.plugins]);if(!e.present)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(eV,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No auth provider detected"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["Projectlens looks for popular auth libraries — ",(0,eT.jsx)("span",{className:"font-mono",children:"better-auth"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"@clerk/nextjs"}),", ",(0,eT.jsx)("span",{className:"font-mono",children:"next-auth"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"@supabase/supabase-js"}),", ",(0,eT.jsx)("span",{className:"font-mono",children:"lucia"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"firebase"})," and more. Install one to see a breakdown here."]})]})]});let o=e.provider,l=o?.deepSupport??!1;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:o?.name??"Auth",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-foreground",children:[(0,eT.jsx)(eV,{className:"size-4 text-[color:var(--sev-ok)]"}),"Detected"]}),e.version&&(0,eT.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:["v",e.version]})]}),!l&&(0,eT.jsx)("div",{className:"rounded-sm border border-[color:var(--sev-medium)]/30 bg-[color:var(--sev-medium)]/10 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"Provider-level analysis. Deep config introspection (methods, plugins, session) is available for Better Auth."}),e.integration&&(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Integration"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.integration})]}),e.databaseAdapter&&(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3"}),"Adapter"]}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.databaseAdapter.name})]}),e.configPath&&(0,eT.jsx)("div",{className:"border-t border-border pt-2 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.configPath})}),e.clientPath&&(0,eT.jsx)("div",{className:"font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.clientPath})}),o&&(0,eT.jsxs)("a",{href:o.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 border-t border-border pt-2 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[o.name," docs",(0,eT.jsx)(oE,{className:"size-3"})]})]})}),(0,eT.jsx)(oS,{title:"At a glance",children:(0,eT.jsx)("div",{className:"grid grid-cols-3 gap-2 text-center",children:[{label:"Methods",value:e.counts.methods,icon:eH},{label:"Plugins",value:e.counts.plugins,icon:cs},{label:"Issues",value:e.counts.findings,icon:dw}].map(e=>(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 rounded-sm bg-secondary/40 py-2",children:[(0,eT.jsx)(e.icon,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-foreground",children:e.value}),(0,eT.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.label})]},e.label))})}),s.length>0&&(0,eT.jsx)(oS,{title:"Plugins by category",children:(0,eT.jsx)(o$,{segments:s})}),e.socialProviders.length>0&&(0,eT.jsx)(oS,{title:"Social providers",children:(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.socialProviders.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] capitalize text-foreground",children:e},e))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Sign-in methods"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.methods.length})]}),0===e.methods.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-5 text-[color:var(--sev-medium)]"}),"No sign-in methods detected in the config."]}):(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.methods.map(e=>(0,eT.jsx)(cu,{method:e},e.id))})]}),l&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cs,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Plugins"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.plugins.length})]}),0===e.plugins.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(te,{className:"size-5 text-muted-foreground"}),"No ",o?.name??"auth"," plugins are registered."]}):(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.plugins.map(e=>(0,eT.jsx)(cm,{plugin:e,onOpen:()=>n(e)},e.id))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eJ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Configuration"})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:e.config.map(e=>(0,eT.jsx)(cp,{item:e},e.key))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eV,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Auth findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:a.length})]}),0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No authentication issues detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>(0,eT.jsx)(cf,{f:e,onOpen:()=>i(e)},e.id))})]})]}),(0,eT.jsx)(cg,{plugin:t,onClose:()=>n(null)}),(0,eT.jsx)(cx,{finding:r,onClose:()=>i(null)})]})}function cg({plugin:e,onClose:t}){return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:e&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:cd[e.category]}),e.clientMissing&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-medium)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3"}),"client missing"]})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-base",children:e.name}),(0,eT.jsx)(oF,{className:"text-pretty leading-relaxed",children:e.description})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Server"}),(0,eT.jsx)("span",{className:"font-mono text-sm",style:{color:e.detectedServer?"var(--sev-ok)":"var(--muted-foreground)"},children:e.detectedServer?"Registered":"Not found"})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Client"}),(0,eT.jsx)("span",{className:"font-mono text-sm",style:{color:e.needsClient?e.detectedClient?"var(--sev-ok)":"var(--sev-medium)":"var(--muted-foreground)"},children:e.needsClient?e.detectedClient?"Registered":"Missing":"Not required"})]})]}),e.clientMissing&&(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-sm border border-[color:var(--sev-medium)]/30 bg-[color:var(--sev-medium)]/[0.06] p-3",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3.5"}),"Client plugin missing"]}),(0,eT.jsxs)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:["Add ",(0,eT.jsxs)("span",{className:"font-mono",children:[e.id,"Client()"]})," to your"," ",(0,eT.jsx)("span",{className:"font-mono",children:"createAuthClient()"})," plugins so its actions work in the browser."]})]}),e.addsTables&&e.addsTables.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3.5"}),"Database tables added"]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.addsTables.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] text-foreground",children:e},e))}),(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:"Generate and apply migrations after adding this plugin so these tables exist."})]}),(0,eT.jsxs)("a",{href:e.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm border border-border px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:["Plugin docs",(0,eT.jsx)(oE,{className:"size-3.5"})]})]})]})})})}function cx({finding:e,onClose:t}){let n=e?oV(e.severity):null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:e&&n&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("w-fit border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-base leading-relaxed",children:e.title}),(0,eT.jsx)(oF,{className:"sr-only",children:"Authentication finding detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-3.5"}),"Issue"]}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(dm,{className:"size-3.5"}),"Recommendation"]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-pretty text-sm leading-relaxed text-foreground",children:e.recommendation})]}),e.docsUrl&&(0,eT.jsxs)("a",{href:e.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm border border-border px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:["Better Auth docs",(0,eT.jsx)(oE,{className:"size-3.5"})]})]})]})})})}let cv=eL("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),cy=eL("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),cb={ok:"Healthy",missing:"Missing",undocumented:"Undocumented",unused:"Unused",exposed:"Exposed",empty:"Empty"};function ck({v:e}){let{viewIssue:t}=l$(),n=oV(e.severity),r="ok"!==e.status;return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oX(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oX(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:["client"===e.scope?(0,eT.jsx)(co,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dF,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.key}),e.sample&&(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.sample}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.scope}),r?(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:cb[e.status]}):(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(eV,{className:"size-3"}),"OK"]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.note})]}),(0,eT.jsx)(lM,{issue:oX(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cj({v:e,shown:t,onToggle:n}){let[r,i]=(0,eP.useState)(!1),a=void 0===e.value,s=a?"(not set)":""===e.value?"(empty)":e.value,o=e.values?[...e.values].sort((e,t)=>{let n={".env.local":0,".env.example":1};return(n[e.file]??2)-(n[t.file]??2)}):[];return(0,eT.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-3",children:["client"===e.scope?(0,eT.jsx)(co,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dF,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.key}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.scope})]}),(0,eT.jsx)("p",{className:(0,ny.cn)("mt-1.5 break-all font-mono text-xs",a?"text-muted-foreground/60 italic":t?"text-foreground":"tracking-widest text-muted-foreground"),children:a||t?s:"•".repeat(Math.min(28,Math.max(8,(e.value||"").length||12)))})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[!a&&(0,eT.jsx)("button",{type:"button",onClick:()=>{a||navigator.clipboard?.writeText(e.value??"").then(()=>{i(!0),window.setTimeout(()=>i(!1),1400)})},"aria-label":"Copy value",className:"inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:r?(0,eT.jsx)(iq,{className:"size-3.5 text-[color:var(--sev-ok)]"}):(0,eT.jsx)(oC,{className:"size-3.5"})}),(0,eT.jsx)("button",{type:"button",onClick:n,disabled:a,"aria-label":t?"Hide value":"Reveal value","aria-pressed":t,className:"inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground disabled:opacity-30",children:t?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"})})]})]}),o.length>1&&(0,eT.jsx)("div",{className:"ml-7 flex flex-col gap-1 border-l border-border/50 pl-3 text-xs",children:o.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.file}),(0,eT.jsx)("span",{className:(0,ny.cn)("font-mono truncate",null===e.value?"text-muted-foreground/60 italic":"text-foreground"),children:null===e.value?"(not set)":""===e.value?"(empty)":t?e.value:"•".repeat(Math.min(12,Math.max(4,(e.value||"").length||8)))})]},e.file))})]})}function cw({env:e}){let[t,n]=(0,eP.useState)(!1),[r,i]=(0,eP.useState)(new Set),a=(0,eP.useMemo)(()=>[...e.variables].sort((e,t)=>e.key.localeCompare(t.key)),[e.variables]),s=a.filter(e=>void 0!==e.value);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Variable values"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[s.length," set"]})]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{n(e=>!e),i(new Set)},"aria-pressed":t,className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[t?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"}),t?"Hide all":"Reveal all"]})]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:"Values are read from your local env files and rendered only in your browser. They are hidden by default — use the eye toggle to reveal a single value or reveal all at once."}),0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No environment variables found."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>{let n;return(0,eT.jsx)(cj,{v:e,shown:(n=e.key,t||r.has(n)),onToggle:()=>{let t;return t=e.key,i(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}},e.key)})})]})}function cN({env:e}){let[t,n]=(0,eP.useState)("audit"),[r,i]=(0,eP.useState)("all"),a=(0,eP.useMemo)(()=>[...e.variables].sort(oq),[e.variables]),s=(0,eP.useMemo)(()=>"all"===r?a:"issues"===r?a.filter(e=>"ok"!==e.status):a.filter(e=>e.status===r),[a,r]),o=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.variables)t.set(n.status,(t.get(n.status)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:cb[e],count:t})).sort((e,t)=>t.count-e.count)},[e.variables]),l=[{label:"Server",value:e.counts.server,color:"var(--chart-1)"},{label:"Client",value:e.counts.client,color:"var(--chart-3)"}],d=e.variables.filter(e=>"exposed"===e.status).length,c=e.variables.filter(e=>"missing"===e.status).length,u=[{key:"audit",label:"Audit",icon:sn,count:e.counts.issues},{key:"values",label:"Values",icon:oT,count:e.counts.total}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:u.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-4"}),e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"values"===t?(0,eT.jsx)(cw,{env:e}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Variables",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.issues}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"with issues"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:d>0?"var(--sev-critical)":"var(--sev-ok)"},children:d}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"exposed"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:c>0?"var(--sev-high)":"var(--sev-ok)"},children:c}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"missing"})]})]})}),(0,eT.jsx)(oS,{title:"By scope",children:(0,eT.jsx)(o$,{segments:l})}),(0,eT.jsx)(oS,{title:"By status",children:(0,eT.jsx)(oI,{rows:o,activeKey:"all"===r||"issues"===r?null:r,onSelect:e=>i(t=>t===e?"all":e)})}),(0,eT.jsx)(oS,{title:"Env files",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.files.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)(si,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.present?"text-foreground":"text-muted-foreground line-through"),children:e.path})]}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.present?`${e.vars}`:"—"})]},e.path))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[{key:"all",label:"All",count:e.counts.total},{key:"issues",label:"Issues",count:e.counts.issues},...o.filter(e=>"ok"!==e.key).map(e=>({key:e.key,label:e.label,count:e.count}))].map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",r===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Environment variables"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:s.length})]}),0===s.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No variables in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:s.map(e=>(0,eT.jsx)(ck,{v:e},e.key))})]})]})]})}let c_=eL("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);function cS(e){let t=e.issues.map(e=>oV(e.severity).rank);return t.length?Math.max(...t):0}function c$({call:e}){let{viewIssue:t}=l$(),n=[...e.issues].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank)[0],r=n?oV(n.severity):null;return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oQ(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oQ(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[e.secure?(0,eT.jsx)(dm,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dD,{className:"mt-0.5 size-4 shrink-0 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:e.method}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:e.url})]}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:e.client}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:e.external?"external":"internal"}),r&&(0,eT.jsxs)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",r.bg,r.text),children:[e.issues.length," ",1===e.issues.length?"issue":"issues"]})]}),n&&(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:n.message})]}),(0,eT.jsx)(lM,{issue:oQ(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cI({network:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)("all"),a=(0,eP.useMemo)(()=>[...e.calls].sort((e,t)=>cS(t)-cS(e)),[e.calls]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.calls)t.set(n.method,(t.get(n.method)??0)+1);let n=[...t.entries()].sort((e,t)=>t[1]-e[1]);return[{key:"all",count:e.calls.length},...n.map(([e,t])=>({key:e,count:t}))]},[e.calls]),o=(0,eP.useMemo)(()=>{let e=(()=>{switch(t){case"external":return a.filter(e=>e.external);case"insecure":return a.filter(e=>!e.secure);case"issues":return a.filter(e=>e.issues.length>0);default:return a}})();return"all"===r?e:e.filter(e=>e.method===r)},[a,t,r]),l=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.domains)t.set(n.category,(t.get(n.category)??0)+n.calls);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.domains]),d=[{label:"HTTPS",value:e.calls.filter(e=>e.secure).length,color:"var(--chart-1)"},{label:"HTTP",value:e.calls.filter(e=>!e.secure).length,color:"var(--chart-3)"}],c=[{key:"all",label:"All",count:e.counts.total},{key:"issues",label:"Issues",count:e.counts.issues},{key:"external",label:"External",count:e.counts.external},{key:"insecure",label:"Insecure",count:e.counts.insecure}];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Requests",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total calls"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.external}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"external"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:e.counts.insecure>0?"var(--sev-high)":"var(--sev-ok)"},children:e.counts.insecure}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"insecure"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.domains.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"hosts"})]})]})}),(0,eT.jsx)(oS,{title:"By scheme",children:(0,eT.jsx)(o$,{segments:d})}),(0,eT.jsx)(oS,{title:"Traffic by category",children:(0,eT.jsx)(oI,{rows:l})}),(0,eT.jsx)(oS,{title:"Hosts",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.domains.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between gap-2 font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.external?(0,eT.jsx)(s2,{className:"size-3 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eG,{className:"size-3 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.host})]}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.calls})]},e.host))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:c.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),s.length>2&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 pr-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(c_,{className:"size-3.5"}),"Method"]}),s.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2 py-1 font-mono text-[11px] uppercase transition-colors",r===e.key?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:["all"===e.key?"All":e.key,(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.count})]},e.key))]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eG,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Outbound requests"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:o.length})]}),0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No requests in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:o.map(e=>(0,eT.jsx)(c$,{call:e},e.id))})]})]})}let cE=eL("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),cC=eL("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),cA=eL("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),cT=eL("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),cP=eL("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),cz=eL("git-graph",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v6",key:"158jrl"}],["circle",{cx:"5",cy:"18",r:"3",key:"104gr9"}],["path",{d:"M12 3v18",key:"108xh3"}],["circle",{cx:"19",cy:"6",r:"3",key:"108a5v"}],["path",{d:"M16 15.7A9 9 0 0 0 19 9",key:"1e3vqb"}]]),cO=eL("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]),cM=eL("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]),cR=eL("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),cD=eL("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]),cL=eL("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]),cU=eL("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]),cZ=eL("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["ERROR_REVALIDATE_EVENT",0,3,"FOCUS_EVENT",0,0,"MUTATE_EVENT",0,2,"RECONNECT_EVENT",0,1],67005);var cF=Object.prototype.hasOwnProperty;let cB=new WeakMap,cV=()=>{},cq=cV(),cW=Object,cH=e=>e===cq,cG=(e,t)=>({...e,...t}),cK={},cJ={},cY="undefined",cX=typeof window!=cY,cQ=typeof document!=cY,c0=cX&&"Deno"in window,c1=(e,t)=>{let n=cB.get(e);return[()=>!cH(t)&&e.get(t)||cK,r=>{if(!cH(t)){let i=e.get(t);t in cJ||(cJ[t]=i),n[5](t,cG(i,r),i||cK)}},n[6],()=>!cH(t)&&t in cJ?cJ[t]:!cH(t)&&e.get(t)||cK]},c2=!0,[c4,c5]=cX&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[cV,cV],c6={initFocus:e=>(cQ&&document.addEventListener("visibilitychange",e),c4("focus",e),()=>{cQ&&document.removeEventListener("visibilitychange",e),c5("focus",e)}),initReconnect:e=>{let t=()=>{c2=!0,e()},n=()=>{c2=!1};return c4("online",t),c4("offline",n),()=>{c5("online",t),c5("offline",n)}}},c3=!eP.default.useId,c9=!cX||c0,c8=c9?eP.useEffect:eP.useLayoutEffect,c7="u">typeof navigator&&navigator.connection,ue=!c9&&c7&&(["slow-2g","2g"].includes(c7.effectiveType)||c7.saveData),ut=new WeakMap,un=(e,t)=>e===`[object ${t}]`,ur=0,ui=e=>{let t,n,r=typeof e,i=cW.prototype.toString.call(e),a=un(i,"Date"),s=un(i,"RegExp"),o=un(i,"Object");if(cW(e)!==e||a||s)t=a?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=ut.get(e))return t;if(t=++ur+"~",ut.set(e,t),Array.isArray(e)){for(n=0,t="@";n<e.length;n++)t+=ui(e[n])+",";ut.set(e,t)}if(o){t="#";let r=cW.keys(e).sort();for(;!cH(n=r.pop());)cH(e[n])||(t+=n+":"+ui(e[n])+",");ut.set(e,t)}}return t},ua=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?ui(e):"",t]},us=0,uo=()=>++us;async function ul(...e){let[t,n,r,i]=e,a=cG({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),s=a.populateCache,o=a.rollbackOnError,l=a.optimisticData,d=a.throwOnError;if("function"==typeof n){let e=[];for(let r of t.keys())!/^\$(inf|sub)\$/.test(r)&&n(t.get(r)._k)&&e.push(r);return Promise.all(e.map(c))}return c(n);async function c(n){let i,[c]=ua(n);if(!c)return;let[u,m]=c1(t,c),[p,f,h,g]=cB.get(t),x=()=>{let e=p[c];return("function"==typeof a.revalidate?a.revalidate(u().data,n):!1!==a.revalidate)&&(delete h[c],delete g[c],e&&e[0])?e[0](2).then(()=>u().data):u().data};if(e.length<3)return x();let v=r,y=!1,b=uo();f[c]=[b,0];let k=!cH(l),j=u(),w=j.data,N=j._c,_=cH(N)?w:N;if(k&&m({data:l="function"==typeof l?l(_,w):l,_c:_}),"function"==typeof v)try{v=v(_)}catch(e){i=e,y=!0}if(v&&"function"==typeof v.then){let e;if(v=await v.catch(e=>{i=e,y=!0}),b!==f[c][0]){if(y)throw i;return v}y&&k&&(e=i,"function"==typeof o?o(e):!1!==o)&&(s=!0,m({data:_,_c:cq}))}if(s&&!y&&("function"==typeof s?m({data:s(v,_),error:cq,_c:cq}):m({data:v,error:cq,_c:cq})),f[c][1]=uo(),Promise.resolve(x()).then(()=>{m({_c:cq})}),y){if(d)throw i;return}return v}}let ud=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},uc=(e,t)=>{if(!cB.has(e)){let n=cG(c6,t),r=Object.create(null),i=ul.bind(cq,e),a=cV,s=Object.create(null),o=(e,t)=>{let n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},l=(t,n,r)=>{e.set(t,n);let i=s[t];if(i)for(let e of i)e(n,r)},d=()=>{if(!cB.has(e)&&(cB.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,o]),!c9)){let t=n.initFocus(setTimeout.bind(cq,ud.bind(cq,r,0))),i=n.initReconnect(setTimeout.bind(cq,ud.bind(cq,r,1)));a=()=>{t&&t(),i&&i(),cB.delete(e)}}};return d(),[e,i,d,a]}return[e,cB.get(e)[4]]},[uu,um]=uc(new Map),up=cG({onLoadingSlow:cV,onSuccess:cV,onError:cV,onErrorRetry:(e,t,n,r,i)=>{let a=n.errorRetryCount,s=i.retryCount,o=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;(cH(a)||!(s>a))&&setTimeout(r,o,i)},onDiscarded:cV,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ue?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:ue?5e3:3e3,compare:function e(t,n){var r,i;if(t===n)return!0;if(t&&n&&(r=t.constructor)===n.constructor){if(r===Date)return t.getTime()===n.getTime();if(r===RegExp)return t.toString()===n.toString();if(r===Array){if((i=t.length)===n.length)for(;i--&&e(t[i],n[i]););return -1===i}if(!r||"object"==typeof t){for(r in i=0,t)if(cF.call(t,r)&&++i&&!cF.call(n,r)||!(r in n)||!e(t[r],n[r]))return!1;return Object.keys(n).length===i}}return t!=t&&n!=n},isPaused:()=>!1,cache:uu,mutate:um,fallback:{}},{isOnline:()=>c2,isVisible:()=>{let e=cQ&&document.visibilityState;return cH(e)||"hidden"!==e}}),uf=(e,t)=>{let n=cG(e,t);if(t){let{use:r,fallback:i}=e,{use:a,fallback:s}=t;r&&a&&(n.use=r.concat(a)),i&&s&&(n.fallback=cG(i,s))}return n},uh=(0,eP.createContext)({});var ug=e.i(67005);let ux=cX&&window.__SWR_DEVTOOLS_USE__,uv=(ux?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,n,r)=>{let i=n&&((...e)=>{let[r]=ua(t),[,,,i]=cB.get(uu);if(r.startsWith("$inf$"))return n(...e);let a=i[r];return cH(a)?n(...e):(delete i[r],a)});return e(t,i,r)});ux&&(window.__SWR_DEVTOOLS_REACT__=eP.default);let uy=()=>{},ub=uy(),uk=(new WeakMap,eP.default.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}})),uj={dedupe:!0},uw=Promise.resolve(cq),uN=()=>cV;cW.defineProperty(e=>{let{value:t}=e,n=(0,eP.useContext)(uh),r="function"==typeof t,i=(0,eP.useMemo)(()=>r?t(n):t,[r,n,t]),a=(0,eP.useMemo)(()=>r?i:uf(n,i),[r,n,i]),s=i&&i.provider,o=(0,eP.useRef)(cq);s&&!o.current&&(o.current=uc(s(a.cache||uu),i));let l=o.current;return l&&(a.cache=l[0],a.mutate=l[1]),c8(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,eP.createElement)(uh.Provider,cG(e,{value:a}))},"defaultValue",{value:up});let u_=(n=(e,t,n)=>{let{cache:r,compare:i,suspense:a,fallbackData:s,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:d,refreshWhenHidden:c,refreshWhenOffline:u,keepPreviousData:m,strictServerPrefetchWarning:p}=n,[f,h,g,x]=cB.get(r),[v,y]=ua(e),b=(0,eP.useRef)(!1),k=(0,eP.useRef)(!1),j=(0,eP.useRef)(v),w=(0,eP.useRef)(t),N=(0,eP.useRef)(n),_=()=>N.current.isVisible()&&N.current.isOnline(),[S,$,I,E]=c1(r,v),C=(0,eP.useRef)({}).current,A=cH(s)?cH(n.fallback)?cq:n.fallback[v]:s,T=(e,t)=>{for(let n in C)if("data"===n){if(!i(e[n],t[n])&&(!cH(e[n])||!i(Z,t[n])))return!1}else if(t[n]!==e[n])return!1;return!0},P=!b.current,z=(0,eP.useMemo)(()=>{let e=S(),n=E(),r=e=>{let n=cG(e);return(delete n._k,(()=>{if(!v||!t||N.current.isPaused())return!1;if(P&&!cH(o))return o;let e=cH(A)?n.data:A;return cH(e)||l})())?{isValidating:!0,isLoading:!0,...n}:n},i=r(e),a=e===n?i:r(n),s=i;return[()=>{let e=r(S());return T(e,s)?(s.data=e.data,s.isLoading=e.isLoading,s.isValidating=e.isValidating,s.error=e.error,s):(s=e,e)},()=>a]},[r,v]),O=(0,tL.useSyncExternalStore)((0,eP.useCallback)(e=>I(v,(t,n)=>{T(n,t)||e()}),[r,v]),z[0],z[1]),M=f[v]&&f[v].length>0,R=O.data,D=cH(R)?A&&"function"==typeof A.then?uk(A):A:R,L=O.error,U=(0,eP.useRef)(D),Z=m?cH(R)?cH(U.current)?D:U.current:R:D,F=v&&cH(D),B=(0,eP.useRef)(null);c9||(0,tL.useSyncExternalStore)(uN,()=>(B.current=!1,B),()=>(B.current=!0,B));let V=B.current;p&&V&&!a&&F&&console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let q=!(!v||!t||N.current.isPaused())&&(!M||!!cH(L))&&(P&&!cH(o)?o:a?!cH(D)&&l:cH(D)||l),W=P&&q,H=cH(O.isValidating)?W:O.isValidating,G=cH(O.isLoading)?W:O.isLoading,K=(0,eP.useCallback)(async e=>{let t,r,a=w.current;if(!v||!a||k.current||N.current.isPaused())return!1;let s=!0,o=e||{},l=!g[v]||!o.dedupe,d=()=>c3?!k.current&&v===j.current&&b.current:v===j.current,c={isValidating:!1,isLoading:!1},u=()=>{$(c)},m=()=>{let e=g[v];e&&e[1]===r&&delete g[v]},p={isValidating:!0};cH(S().data)&&(p.isLoading=!0);try{if(l&&($(p),n.loadingTimeout&&cH(S().data)&&setTimeout(()=>{s&&d()&&N.current.onLoadingSlow(v,n)},n.loadingTimeout),g[v]=[a(y),uo()]),[t,r]=g[v],t=await t,l&&setTimeout(m,n.dedupingInterval),!g[v]||g[v][1]!==r)return l&&d()&&N.current.onDiscarded(v),!1;c.error=cq;let e=h[v];if(!cH(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return u(),l&&d()&&N.current.onDiscarded(v),!1;let o=S().data;c.data=i(o,t)?o:t,l&&d()&&N.current.onSuccess(t,v,n)}catch(n){m();let e=N.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=n,l&&d())&&(e.onError(n,v,e),(!0===t||"function"==typeof t&&t(n))&&(!N.current.revalidateOnFocus||!N.current.revalidateOnReconnect||_())&&e.onErrorRetry(n,v,e,e=>{let t=f[v];t&&t[0]&&t[0](ug.ERROR_REVALIDATE_EVENT,e)},{retryCount:(o.retryCount||0)+1,dedupe:!0}))}return s=!1,u(),!0},[v,r]),J=(0,eP.useCallback)((...e)=>ul(r,j.current,...e),[]);if(c8(()=>{w.current=t,N.current=n,cH(R)||(U.current=R)}),c8(()=>{var e;let t;if(!v)return;let n=K.bind(cq,uj),r=0;N.current.revalidateOnFocus&&(r=Date.now()+N.current.focusThrottleInterval);let i=(e=(e,t={})=>{if(e==ug.FOCUS_EVENT){let e=Date.now();N.current.revalidateOnFocus&&e>r&&_()&&(r=e+N.current.focusThrottleInterval,n())}else if(e==ug.RECONNECT_EVENT)N.current.revalidateOnReconnect&&_()&&n();else if(e==ug.MUTATE_EVENT)return K();else if(e==ug.ERROR_REVALIDATE_EVENT)return K(t)},(t=f[v]||(f[v]=[])).push(e),()=>{let n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.pop())});if(k.current=!1,j.current=v,b.current=!0,$({_k:y}),q&&!g[v])if(cH(D)||c9)n();else cX&&typeof window.requestAnimationFrame!=cY?window.requestAnimationFrame(n):setTimeout(n,1);return()=>{k.current=!0,i()}},[v]),c8(()=>{let e;function t(){let t="function"==typeof d?d(S().data):d;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!S().error&&(c||N.current.isVisible())&&(u||N.current.isOnline())?K(uj).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[d,c,u,v]),(0,eP.useDebugValue)(Z),a){if(!c3&&c9&&F)throw Error("Fallback data is required when using Suspense in SSR.");F&&(w.current=t,N.current=n,k.current=!1);let e=x[v];if(uk(!cH(e)&&F?J(e):uw),!cH(L)&&F)throw L;let r=F?K(uj):uw;!cH(Z)&&F&&(r.status="fulfilled",r.value=!0),uk(r)}return{mutate:J,get data(){return C.data=!0,Z},get error(){return C.error=!0,L},get isValidating(){return C.isValidating=!0,H},get isLoading(){return C.isLoading=!0,G}}},function(...e){let t,r=(t=(0,eP.useContext)(uh),(0,eP.useMemo)(()=>cG(up,t),[t])),[i,a,s]="function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],o=uf(r,s),l=n,{use:d}=o,c=(d||[]).concat(uv);for(let e=c.length;e--;)l=c[e](l);return l(i,a||o.fetcher||null,o)}),uS=eL("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),u$=eL("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]),uI=eL("trophy",[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]]),uE=eL("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),uC=eL("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);function uA(){}function uT(){}let uP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uO={};function uM(e,t){return((t||uO).jsx?uz:uP).test(e)}let uR=/[ \t\n\f\r]/g;function uD(e){return""===e.replace(uR,"")}class uL{constructor(e,t){this.attribute=t,this.property=e}}uL.prototype.attribute="",uL.prototype.booleanish=!1,uL.prototype.boolean=!1,uL.prototype.commaOrSpaceSeparated=!1,uL.prototype.commaSeparated=!1,uL.prototype.defined=!1,uL.prototype.mustUseProperty=!1,uL.prototype.number=!1,uL.prototype.overloadedBoolean=!1,uL.prototype.property="",uL.prototype.spaceSeparated=!1,uL.prototype.space=void 0;let uU=0,uZ=uG(),uF=uG(),uB=uG(),uV=uG(),uq=uG(),uW=uG(),uH=uG();function uG(){return 2**++uU}e.s(["boolean",0,uZ,"booleanish",0,uF,"commaOrSpaceSeparated",0,uH,"commaSeparated",0,uW,"number",0,uV,"overloadedBoolean",0,uB,"spaceSeparated",0,uq],35999);var uK=e.i(35999);let uJ=Object.keys(uK);class uY extends uL{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<uJ.length;){const e=uJ[i];!function(e,t,n){n&&(e[t]=n)}(this,uJ[i],(n&uK[e])===uK[e])}}}function uX(e){return e.toLowerCase()}uY.prototype.defined=!0;let uQ=/[A-Z]/g,u0=/-[a-z]/g,u1=/^data[-\w.:]+$/i;function u2(e){return"-"+e.toLowerCase()}function u4(e){return e.charAt(1).toUpperCase()}let u5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class u6{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function u3(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new u6(n,r,t)}function u9(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new uY(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[uX(r)]=r,n[uX(a.attribute)]=r}return new u6(t,n,e.space)}u6.prototype.normal={},u6.prototype.property={},u6.prototype.space=void 0;let u8=u9({properties:{ariaActiveDescendant:null,ariaAtomic:uF,ariaAutoComplete:null,ariaBusy:uF,ariaChecked:uF,ariaColCount:uV,ariaColIndex:uV,ariaColSpan:uV,ariaControls:uq,ariaCurrent:null,ariaDescribedBy:uq,ariaDetails:null,ariaDisabled:uF,ariaDropEffect:uq,ariaErrorMessage:null,ariaExpanded:uF,ariaFlowTo:uq,ariaGrabbed:uF,ariaHasPopup:null,ariaHidden:uF,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uq,ariaLevel:uV,ariaLive:null,ariaModal:uF,ariaMultiLine:uF,ariaMultiSelectable:uF,ariaOrientation:null,ariaOwns:uq,ariaPlaceholder:null,ariaPosInSet:uV,ariaPressed:uF,ariaReadOnly:uF,ariaRelevant:null,ariaRequired:uF,ariaRoleDescription:uq,ariaRowCount:uV,ariaRowIndex:uV,ariaRowSpan:uV,ariaSelected:uF,ariaSetSize:uV,ariaSort:null,ariaValueMax:uV,ariaValueMin:uV,ariaValueNow:uV,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function u7(e,t){return t in e?e[t]:t}function me(e,t){return u7(e,t.toLowerCase())}let mt=u9({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:uW,acceptCharset:uq,accessKey:uq,action:null,allow:null,allowFullScreen:uZ,allowPaymentRequest:uZ,allowUserMedia:uZ,alpha:uZ,alt:null,as:null,async:uZ,autoCapitalize:null,autoComplete:uq,autoFocus:uZ,autoPlay:uZ,blocking:uq,capture:null,charSet:null,checked:uZ,cite:null,className:uq,closedBy:null,colorSpace:null,cols:uV,colSpan:uV,command:null,commandFor:null,content:null,contentEditable:uF,controls:uZ,controlsList:uq,coords:uV|uW,crossOrigin:null,data:null,dateTime:null,decoding:null,default:uZ,defer:uZ,dir:null,dirName:null,disabled:uZ,download:uB,draggable:uF,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:uZ,formTarget:null,headers:uq,height:uV,hidden:uB,high:uV,href:null,hrefLang:null,htmlFor:uq,httpEquiv:uq,id:null,imageSizes:null,imageSrcSet:null,inert:uZ,inputMode:null,integrity:null,is:null,isMap:uZ,itemId:null,itemProp:uq,itemRef:uq,itemScope:uZ,itemType:uq,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:uZ,low:uV,manifest:null,max:null,maxLength:uV,media:null,method:null,min:null,minLength:uV,multiple:uZ,muted:uZ,name:null,nonce:null,noModule:uZ,noValidate:uZ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:uZ,optimum:uV,pattern:null,ping:uq,placeholder:null,playsInline:uZ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:uZ,referrerPolicy:null,rel:uq,required:uZ,reversed:uZ,rows:uV,rowSpan:uV,sandbox:uq,scope:null,scoped:uZ,seamless:uZ,selected:uZ,shadowRootClonable:uZ,shadowRootCustomElementRegistry:uZ,shadowRootDelegatesFocus:uZ,shadowRootMode:null,shadowRootSerializable:uZ,shape:null,size:uV,sizes:null,slot:null,span:uV,spellCheck:uF,src:null,srcDoc:null,srcLang:null,srcSet:null,start:uV,step:null,style:null,tabIndex:uV,target:null,title:null,translate:null,type:null,typeMustMatch:uZ,useMap:null,value:uF,width:uV,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uq,axis:null,background:null,bgColor:null,border:uV,borderColor:null,bottomMargin:uV,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:uZ,declare:uZ,event:null,face:null,frame:null,frameBorder:null,hSpace:uV,leftMargin:uV,link:null,longDesc:null,lowSrc:null,marginHeight:uV,marginWidth:uV,noResize:uZ,noHref:uZ,noShade:uZ,noWrap:uZ,object:null,profile:null,prompt:null,rev:null,rightMargin:uV,rules:null,scheme:null,scrolling:uF,standby:null,summary:null,text:null,topMargin:uV,valueType:null,version:null,vAlign:null,vLink:null,vSpace:uV,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:uZ,disablePictureInPicture:uZ,disableRemotePlayback:uZ,exportParts:uW,part:uq,prefix:null,property:null,results:uV,security:null,unselectable:null},space:"html",transform:me}),mn=u9({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:uH,accentHeight:uV,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:uV,amplitude:uV,arabicForm:null,ascent:uV,attributeName:null,attributeType:null,azimuth:uV,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:uV,by:null,calcMode:null,capHeight:uV,className:uq,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:uV,diffuseConstant:uV,direction:null,display:null,dur:null,divisor:uV,dominantBaseline:null,download:uZ,dx:null,dy:null,edgeMode:null,editable:null,elevation:uV,enableBackground:null,end:null,event:null,exponent:uV,externalResourcesRequired:null,fill:null,fillOpacity:uV,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:uW,g2:uW,glyphName:uW,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:uV,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:uV,horizOriginX:uV,horizOriginY:uV,id:null,ideographic:uV,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:uV,k:uV,k1:uV,k2:uV,k3:uV,k4:uV,kernelMatrix:uH,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:uV,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:uV,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:uV,overlineThickness:uV,paintOrder:null,panose1:null,path:null,pathLength:uV,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uq,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:uV,pointsAtY:uV,pointsAtZ:uV,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:uH,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:uH,rev:uH,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:uH,requiredFeatures:uH,requiredFonts:uH,requiredFormats:uH,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:uV,specularExponent:uV,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:uV,strikethroughThickness:uV,string:null,stroke:null,strokeDashArray:uH,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:uV,strokeOpacity:uV,strokeWidth:null,style:null,surfaceScale:uV,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:uH,tabIndex:uV,tableValues:null,target:null,targetX:uV,targetY:uV,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:uH,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:uV,underlineThickness:uV,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:uV,values:null,vAlphabetic:uV,vMathematical:uV,vectorEffect:null,vHanging:uV,vIdeographic:uV,version:null,vertAdvY:uV,vertOriginX:uV,vertOriginY:uV,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:uV,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:u7}),mr=u9({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),mi=u9({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:me}),ma=u9({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ms=u3([u8,mt,mr,mi,ma],"html"),mo=u3([u8,mn,mr,mi,ma],"svg");var ml=e.i(63185);let md=mu("end"),mc=mu("start");function mu(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function mm(e){return e&&"object"==typeof e?"position"in e||"type"in e?mf(e.position):"start"in e||"end"in e?mf(e):"line"in e||"column"in e?mp(e):"":""}function mp(e){return mh(e&&e.line)+":"+mh(e&&e.column)}function mf(e){return mp(e&&e.start)+"-"+mp(e&&e.end)}function mh(e){return e&&"number"==typeof e?e:1}class mg extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=mm(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mg.prototype.file="",mg.prototype.name="",mg.prototype.reason="",mg.prototype.message="",mg.prototype.stack="",mg.prototype.column=void 0,mg.prototype.line=void 0,mg.prototype.ancestors=void 0,mg.prototype.cause=void 0,mg.prototype.fatal=void 0,mg.prototype.place=void 0,mg.prototype.ruleId=void 0,mg.prototype.source=void 0;let mx={}.hasOwnProperty,mv=new Map,my=/[A-Z]/g,mb=new Set(["table","tbody","thead","tfoot","tr"]),mk=new Set(["td","th"]),mj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mw(e,t,n){var r,i,a,s,o,l,d,c,u;let m,p,f,h,g,x,v,y,b,k,j;return"element"===t.type?(r=e,i=t,a=n,p=m=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===m.space&&(r.schema=mo),r.ancestors.push(i),f=m$(r,i.tagName,!1),h=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&mx.call(t.properties,r)){let a=function(e,t,n){let r=function(e,t){let n=uX(t),r=t,i=uL;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&u1.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(u0,u4);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!u0.test(e)){let n=e.replace(uQ,u2);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=uY}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,ml.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new mg("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=mj+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)mx.call(e,t)&&(n[function(e){let t=e.replace(my,mE);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?u5[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(a){let[r,s]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&mk.has(t.tagName)?n=s:i[r]=s}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),g=mS(r,i),mb.has(i.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&uD(e.value):uD(e))})),mN(r,h,f,i),m_(h,g),r.ancestors.pop(),r.schema=m,r.create(i,f,h,a)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return uA("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}mI(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(s=e,o=t,l=n,v=x=s.schema,"svg"===o.name&&"html"===x.space&&(s.schema=mo),s.ancestors.push(o),y=null===o.name?s.Fragment:m$(s,o.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];uA("ExpressionStatement"===t.type);let i=t.expression;uA("ObjectExpression"===i.type);let a=i.properties[0];uA("SpreadElement"===a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else mI(e,t.position);else{let i,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];uA("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else mI(e,t.position);else i=null===r.value||r.value;n[a]=i}return n}(s,o),k=mS(s,o),mN(s,b,y,o),m_(b,k),s.ancestors.pop(),s.schema=x,s.create(o,y,b,l)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mI(e,t.position)}(e,t):"root"===t.type?(d=e,c=t,u=n,m_(j={},mS(d,c)),d.create(c,d.Fragment,j,u)):"text"===t.type?t.value:void 0}function mN(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function m_(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function mS(e,t){let n=[],r=-1,i=e.passKeys?new Map:mv;for(;++r<t.children.length;){let a,s=t.children[r];if(e.passKeys){let e="element"===s.type?s.tagName:"mdxJsxFlowElement"===s.type||"mdxJsxTextElement"===s.type?s.name:void 0;if(e){let t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}let o=mw(e,s,a);void 0!==o&&n.push(o)}return n}function m$(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=uM(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}uA(e,"always a result"),r=e}else r=uM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return mx.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);mI(e)}function mI(e,t){let n=new mg("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function mE(e){return"-"+e.toLowerCase()}let mC={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mA={};function mT(e,t){let n=t||mA;return mP(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function mP(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mz(e.children,t,n)}return Array.isArray(e)?mz(e,t,n):""}function mz(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=mP(e[i],t,n);return r.join("")}function mO(e,t,n,r){let i,a=e.length,s=0;if(t=t<0?-t>a?0:a+t:t>a?a:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);s<r.length;)(i=r.slice(s,s+1e4)).unshift(t,0),e.splice(...i),s+=1e4,t+=1e4}function mM(e,t){return e.length>0?(mO(e,e.length,0,t),e):t}let mR={}.hasOwnProperty;function mD(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(mR.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(r in a){mR.call(i,r)||(i[r]=[]);let e=a[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);mO(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let mL=mY(/[A-Za-z]/),mU=mY(/[\dA-Za-z]/),mZ=mY(/[#-'*+\--9=?A-Z^-~]/);function mF(e){return null!==e&&(e<32||127===e)}let mB=mY(/\d/),mV=mY(/[\dA-Fa-f]/),mq=mY(/[!-/:-@[-`{-~]/);function mW(e){return null!==e&&e<-2}function mH(e){return null!==e&&(e<0||32===e)}function mG(e){return -2===e||-1===e||32===e}let mK=mY(/\p{P}|\p{S}/u),mJ=mY(/\s/);function mY(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function mX(e,t,n,r){let i=r?r-1:1/0,a=0;return function(r){return mG(r)?(e.enter(n),function r(s){return mG(s)&&a++<i?(e.consume(s),r):(e.exit(n),t(s))}(r)):t(r)}}let mQ={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return mW(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},m0={tokenize:function(e){let t,n,r,i=this,a=[],s=0;return o;function o(t){if(s<a.length){let n=a[s];return i.containerState=n[1],e.attempt(n[0].continuation,l,d)(t)}return d(t)}function l(e){if(s++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&x();let r=i.events.length,a=r;for(;a--;)if("exit"===i.events[a][0]&&"chunkFlow"===i.events[a][1].type){n=i.events[a][1].end;break}g(s);let o=r;for(;o<i.events.length;)i.events[o][1].end={...n},o++;return mO(i.events,a+1,0,i.events.slice(r)),i.events.length=o,d(e)}return o(e)}function d(n){if(s===a.length){if(!t)return m(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(m1,c,u)(n)}function c(e){return t&&x(),g(s),m(e)}function u(e){return i.parser.lazy[i.now().line]=s!==a.length,r=i.now().offset,f(e)}function m(t){return i.containerState={},e.attempt(m1,p,f)(t)}function p(e){return s++,a.push([i.currentConstruct,i.containerState]),m(e)}function f(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){h(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return mW(n)?(e.consume(n),h(e.exit("chunkFlow")),s=0,i.interrupt=void 0,o):(e.consume(n),t)}(r)}function h(e,a){let o=i.sliceStream(e);if(a&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),i.parser.lazy[e.start.line]){let e,n,a=t.events.length;for(;a--;)if(t.events[a][1].start.offset<r&&(!t.events[a][1].end||t.events[a][1].end.offset>r))return;let o=i.events.length,l=o;for(;l--;)if("exit"===i.events[l][0]&&"chunkFlow"===i.events[l][1].type){if(e){n=i.events[l][1].end;break}e=!0}for(g(s),a=o;a<i.events.length;)i.events[a][1].end={...n},a++;mO(i.events,l+1,0,i.events.slice(o)),i.events.length=a}}function g(t){let n=a.length;for(;n-- >t;){let t=a[n];i.containerState=t[1],t[0].exit.call(i,e)}a.length=t}function x(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},m1={tokenize:function(e,t,n){return mX(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},m2={partial:!0,tokenize:function(e,t,n){return function(t){return mG(t)?mX(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||mW(e)?t(e):n(e)}}};class m4{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&m5(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),m5(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),m5(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);m5(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);m5(this.left,t.reverse())}}}function m5(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function m6(e){let t,n,r,i,a,s,o,l={},d=-1,c=new m4(e);for(;++d<c.length;){for(;d in l;)d=l[d];if(t=c.get(d),d&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(d-1)[1].type&&((r=0)<(s=t[1]._tokenizer.events).length&&"lineEndingBlank"===s[r][1].type&&(r+=2),r<s.length&&"content"===s[r][1].type))for(;++r<s.length&&"content"!==s[r][1].type;)"chunkText"===s[r][1].type&&(s[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(l,function(e,t){let n,r,i=e.get(t)[1],a=e.get(t)[2],s=t-1,o=[],l=i._tokenizer;!l&&(l=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let d=l.events,c=[],u={},m=-1,p=i,f=0,h=0,g=[0];for(;p;){for(;e.get(++s)[1]!==p;);o.push(s),!p._tokenizer&&(n=a.sliceStream(p),p.next||n.push(null),r&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(n),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++m<d.length;)"exit"===d[m][0]&&"enter"===d[m-1][0]&&d[m][1].type===d[m-1][1].type&&d[m][1].start.line!==d[m][1].end.line&&(h=m+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),m=g.length;m--;){let t=d.slice(g[m],g[m+1]),n=o.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),m=-1;++m<c.length;)u[f+c[m][0]]=f+c[m][1],f+=c[m][1]-c[m][0]-1;return u}(c,d)),d=l[d],o=!0);else if(t[1]._container){for(r=d,n=void 0;r--;)if("lineEnding"===(i=c.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(a=c.slice(n,d)).unshift(t),c.splice(n,d-n+1,a))}}return mO(e,0,1/0,c.slice(0)),!o}let m3={resolve:function(e){return m6(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):mW(t)?e.check(m9,a,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},m9={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,i,"linePrefix")};function i(i){if(null===i||mW(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},m8={tokenize:function(e){let t=this,n=e.attempt(m2,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,mX(e,e.attempt(this.parser.constructs.flow,r,e.attempt(m3,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},m7={resolveAll:pr()},pe=pn("string"),pt=pn("text");function pn(e){return{resolveAll:pr("text"===e?pi:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,s);return a;function a(e){return l(e)?i(e):s(e)}function s(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),o)}function l(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function pr(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function pi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],a=t.sliceStream(i),s=a.length,o=-1,l=0;for(;s--;){let e=a[s];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)l++,o--;if(o)break;o=-1}else if(-2===e)r=!0,l++;else if(-1===e);else{s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){let a={type:n===e.length||r||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-l,offset:i.end.offset-l},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}function pa(e){return null===e||mH(e)||mJ(e)?1:mK(e)?2:void 0}function ps(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}let po={name:"attention",resolveAll:function(e,t){let n,r,i,a,s,o,l,d,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let u={...e[n][1].end},m={...e[c][1].start};pl(u,-o),pl(m,o),a={type:o>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:m},i={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:o>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[n][1].end={...a.start},e[c][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=mM(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=mM(l,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=mM(l,ps(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=mM(l,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(d=2,l=mM(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):d=0,mO(e,n-1,c-n+3,l),c=n+l.length-d-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,a=pa(i);return function(s){return n=s,e.enter("attentionSequence"),function s(o){if(o===n)return e.consume(o),s;let l=e.exit("attentionSequence"),d=pa(o),c=!d||2===d&&a||r.includes(o),u=!a||2===a&&d||r.includes(i);return l._open=!!(42===n?c:c&&(a||!u)),l._close=!!(42===n?u:u&&(d||!c)),t(o)}(s)}}};function pl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let pd={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return mG(t)?mX(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(pd,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return mG(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},pc={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return mq(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},pu=document.createElement("i");function pm(e){let t="&"+e+";";pu.innerHTML=t;let n=pu.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let pp={name:"characterReference",tokenize:function(e,t,n){let r,i,a=this,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,i=mU,d(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=mV,d):(e.enter("characterReferenceValue"),r=7,i=mB,d(t))}function d(o){if(59===o&&s){let r=e.exit("characterReferenceValue");return i!==mU||pm(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return i(o)&&s++<r?(e.consume(o),d):n(o)}}},pf={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},ph={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),mG(t)?mX(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(a++,e.consume(i),t):a>=o?(e.exit("codeFencedFenceSequence"),mG(i)?mX(e,d,"whitespace")(i):d(i)):n(i)}(t)):n(t)}function d(r){return null===r||mW(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},s=0,o=0;return function(t){var a;let d;return a=t,s=(d=i.events[i.events.length-1])&&"linePrefix"===d[1].type?d[2].sliceSerialize(d[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o<3?n(i):(e.exit("codeFencedFenceSequence"),mG(i)?mX(e,l,"whitespace")(i):l(i))}(a)};function l(a){return null===a||mW(a)?(e.exit("codeFencedFence"),i.interrupt?t(a):e.check(pf,c,f)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||mW(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(i)):mG(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mX(e,d,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(a))}function d(t){return null===t||mW(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||mW(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function c(t){return e.attempt(a,f,u)(t)}function u(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return s>0&&mG(t)?mX(e,p,"linePrefix",s+1)(t):p(t)}function p(t){return null===t||mW(t)?e.check(pf,c,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||mW(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},pg={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),mX(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?a(n):mW(n)?e.attempt(px,t,a)(n):(e.enter("codeFlowValue"),function n(r){return null===r||mW(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function a(n){return e.exit("codeIndented"),t(n)}}},px={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):mX(e,a,"linePrefix",5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):mW(e)?i(e):n(e)}}};function pv(e,t,n,r,i,a,s,o,l){let d=l||1/0,c=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),u):null===t||32===t||41===t||mF(t)?n(t):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(n))}function m(t){return 62===t?(e.exit("chunkString"),e.exit(o),u(t)):null===t||60===t||mW(t)?n(t):(e.consume(t),92===t?p:m)}function p(t){return 60===t||62===t||92===t?(e.consume(t),m):m(t)}function f(i){return!c&&(null===i||41===i||mH(i))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(i)):c<d&&40===i?(e.consume(i),c++,f):41===i?(e.consume(i),c--,f):null===i||32===i||40===i||mF(i)?n(i):(e.consume(i),92===i?h:f)}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function py(e,t,n,r,i,a){let s,o=this,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),d};function d(u){return l>999||null===u||91===u||93===u&&!s||94===u&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(u):93===u?(e.exit(a),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):mW(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||mW(t)||l++>999?(e.exit("chunkString"),d(t)):(e.consume(t),s||(s=!mG(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function pb(e,t,n,r,i,a){let s;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),s=40===t?41:t,o):n(t)};function o(n){return n===s?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===s?(e.exit(a),o(s)):null===t?n(t):mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return t===s||null===t||mW(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:d)}function c(t){return t===s||92===t?(e.consume(t),d):d(t)}}function pk(e,t){let n;return function r(i){return mW(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mG(i)?mX(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function pj(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let pw={partial:!0,tokenize:function(e,t,n){return function(t){return mH(t)?pk(e,r)(t):n(t)};function r(t){return pb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return mG(t)?mX(e,a,"whitespace")(t):a(t)}function a(e){return null===e||mW(e)?t(e):n(e)}}},pN=["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"],p_=["pre","script","style","textarea"],pS={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(m2,t,n)}}},p$={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},pI={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&mO(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,a,s=e.length,o=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(i=s);let l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[i-2][1].start}};return a=mM(a=[["enter",l,t],["enter",d,t]],e.slice(r+1,r+o+3)),a=mM(a,[["enter",c,t]]),a=mM(a,ps(t.parser.constructs.insideSpan.null,e.slice(r+o+4,i-3),t)),a=mM(a,[["exit",c,t],e[i-2],e[i-1],["exit",d,t]]),a=mM(a,e.slice(i+1)),a=mM(a,[["exit",l,t]]),mO(e,r,e.length,a),e},tokenize:function(e,t,n){let r,i,a=this,s=a.events.length;for(;s--;)if(("labelImage"===a.events[s][1].type||"labelLink"===a.events[s][1].type)&&!a.events[s][1]._balanced){r=a.events[s][1];break}return function(t){return r?r._inactive?c(t):(i=a.parser.defined.includes(pj(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(pE,d,i?d:c)(t):91===t?e.attempt(pC,d,i?l:c)(t):i?d(t):c(t)}function l(t){return e.attempt(pA,d,c)(t)}function d(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},pE={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return mH(t)?pk(e,i)(t):i(t)}function i(t){return 41===t?d(t):pv(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return mH(t)?pk(e,o)(t):d(t)}function s(e){return n(e)}function o(t){return 34===t||39===t||40===t?pb(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):d(t)}function l(t){return mH(t)?pk(e,d)(t):d(t)}function d(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},pC={tokenize:function(e,t,n){let r=this;return function(t){return py.call(r,e,i,a,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(pj(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},pA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},pT={name:"labelStartImage",resolveAll:pI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},pP={name:"labelStartLink",resolveAll:pI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},pz={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),mX(e,t,"linePrefix")}}},pO={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(a){var s;return e.enter("thematicBreak"),r=s=a,function a(s){return s===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),mG(n)?mX(e,a,"whitespace")(n):a(n))}(s)):i>=3&&(null===s||mW(s))?(e.exit("thematicBreak"),t(s)):n(s)}(s)}}},pM={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(m2,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mX(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!mG(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pD,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,mX(e,e.attempt(pM,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,s=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:mB(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(pO,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return mB(i)&&++s<10?(e.consume(i),t):(!r.interrupt||s<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),o(i)):n(i)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(m2,r.interrupt?n:l,e.attempt(pR,c,d))}function l(e){return r.containerState.initialBlankLine=!0,a++,c(e)}function d(t){return mG(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},pR={partial:!0,tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return!mG(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},pD={partial:!0,tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},pL={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);let s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var s;let o,l=i.events.length;for(;l--;)if("lineEnding"!==i.events[l][1].type&&"linePrefix"!==i.events[l][1].type&&"content"!==i.events[l][1].type){o="paragraph"===i.events[l][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||o)?(e.enter("setextHeadingLine"),r=t,s=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),mG(n)?mX(e,a,"lineSuffix")(n):a(n))}(s)):n(t)};function a(r){return null===r||mW(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,py.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function a(t){return(r=pj(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return mH(t)?pk(e,o)(t):o(t)}function o(t){return pv(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(pw,d,d)(t)}function d(t){return mG(t)?mX(e,c,"whitespace")(t):c(t)}function c(a){return null===a||mW(a)?(e.exit("definition"),i.parser.defined.push(r),t(a)):n(a)}}}},"disable",0,{null:[]},"document",0,{42:pM,43:pM,45:pM,48:pM,49:pM,50:pM,51:pM,52:pM,53:pM,54:pM,55:pM,56:pM,57:pM,62:pd},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;return"whitespace"===e[3][1].type&&(a+=2),i-2>a&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4),i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},mO(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var a;return e.enter("atxHeading"),a=i,e.enter("atxHeadingSequence"),function i(a){return 35===a&&r++<6?(e.consume(a),i):null===a||mH(a)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||mW(r)?(e.exit("atxHeading"),t(r)):mG(r)?mX(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||mH(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(a)):n(a)}(a)}}},42:pO,45:[pL,pO],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,a,s,o,l=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),d};function d(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,p):63===s?(e.consume(s),r=3,l.interrupt?t:T):mL(s)?(e.consume(s),a=String.fromCharCode(s),f):n(s)}function c(i){return 45===i?(e.consume(i),r=2,u):91===i?(e.consume(i),r=5,s=0,m):mL(i)?(e.consume(i),r=4,l.interrupt?t:T):n(i)}function u(r){return 45===r?(e.consume(r),l.interrupt?t:T):n(r)}function m(r){let i="CDATA[";return r===i.charCodeAt(s++)?(e.consume(r),s===i.length)?l.interrupt?t:N:m:n(r)}function p(t){return mL(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||mH(s)){let o=47===s,d=a.toLowerCase();return!o&&!i&&p_.includes(d)?(r=1,l.interrupt?t(s):N(s)):pN.includes(a.toLowerCase())?(r=6,o)?(e.consume(s),h):l.interrupt?t(s):N(s):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(s):i?function t(n){return mG(n)?(e.consume(n),t):j(n)}(s):g(s))}return 45===s||mU(s)?(e.consume(s),a+=String.fromCharCode(s),f):n(s)}function h(r){return 62===r?(e.consume(r),l.interrupt?t:N):n(r)}function g(t){return 47===t?(e.consume(t),j):58===t||95===t||mL(t)?(e.consume(t),x):mG(t)?(e.consume(t),g):j(t)}function x(t){return 45===t||46===t||58===t||95===t||mU(t)?(e.consume(t),x):v(t)}function v(t){return 61===t?(e.consume(t),y):mG(t)?(e.consume(t),v):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,b):mG(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||mH(n)?v(n):(e.consume(n),t)}(t)}function b(t){return t===o?(e.consume(t),o=null,k):null===t||mW(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||mG(e)?g(e):n(e)}function j(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||mW(t)?N(t):mG(t)?(e.consume(t),w):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),I):60===t&&1===r?(e.consume(t),E):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),T):93===t&&5===r?(e.consume(t),A):mW(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(pS,z,_)(t)):null===t||mW(t)?(e.exit("htmlFlowData"),_(t)):(e.consume(t),N)}function _(t){return e.check(p$,S,z)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),$}function $(t){return null===t||mW(t)?_(t):(e.enter("htmlFlowData"),N(t))}function I(t){return 45===t?(e.consume(t),T):N(t)}function E(t){return 47===t?(e.consume(t),a="",C):N(t)}function C(t){if(62===t){let n=a.toLowerCase();return p_.includes(n)?(e.consume(t),P):N(t)}return mL(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),C):N(t)}function A(t){return 93===t?(e.consume(t),T):N(t)}function T(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),T):N(t)}function P(t){return null===t||mW(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),P)}function z(n){return e.exit("htmlFlow"),t(n)}}},61:pL,95:pO,96:ph,126:ph},"flowInitial",0,{[-2]:pg,[-1]:pg,32:pg},"insideSpan",0,{null:[po,m7]},"string",0,{38:pp,92:pc},"text",0,{[-5]:pz,[-4]:pz,[-3]:pz,33:pT,38:pp,42:po,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return mL(t)?(e.consume(t),a):64===t?n(t):o(t)}function a(t){return 43===t||45===t||46===t||mU(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,s):(43===n||45===n||46===n||mU(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||mF(r)?n(r):(e.consume(r),s)}function o(t){return 64===t?(e.consume(t),l):mZ(t)?(e.consume(t),o):n(t)}function l(i){return mU(i)?function i(a){return 46===a?(e.consume(a),r=0,l):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(a){if((45===a||mU(a))&&r++<63){let n=45===a?t:i;return e.consume(a),n}return n(a)}(a)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,a,s=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),v):mL(t)?(e.consume(t),j):n(t)}function l(t){return 45===t?(e.consume(t),d):91===t?(e.consume(t),i=0,p):mL(t)?(e.consume(t),x):n(t)}function d(t){return 45===t?(e.consume(t),m):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):mW(t)?(a=c,C(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),m):c(t)}function m(e){return 62===e?E(e):45===e?u(e):c(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):mW(t)?(a=f,C(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?E(t):93===t?(e.consume(t),g):f(t)}function x(t){return null===t||62===t?E(t):mW(t)?(a=x,C(t)):(e.consume(t),x)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):mW(t)?(a=v,C(t)):(e.consume(t),v)}function y(e){return 62===e?E(e):v(e)}function b(t){return mL(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||mU(t)?(e.consume(t),k):function t(n){return mW(n)?(a=t,C(n)):mG(n)?(e.consume(n),t):E(n)}(t)}function j(t){return 45===t||mU(t)?(e.consume(t),j):47===t||62===t||mH(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),E):58===t||95===t||mL(t)?(e.consume(t),N):mW(t)?(a=w,C(t)):mG(t)?(e.consume(t),w):E(t)}function N(t){return 45===t||46===t||58===t||95===t||mU(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),_):mW(n)?(a=t,C(n)):mG(n)?(e.consume(n),t):w(n)}(t)}function _(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,S):mW(t)?(a=_,C(t)):mG(t)?(e.consume(t),_):(e.consume(t),$)}function S(t){return t===r?(e.consume(t),r=void 0,I):null===t?n(t):mW(t)?(a=S,C(t)):(e.consume(t),S)}function $(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||mH(t)?w(t):(e.consume(t),$)}function I(e){return 47===e||62===e||mH(e)?w(e):n(e)}function E(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function C(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return mG(t)?mX(e,T,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):T(t)}function T(t){return e.enter("htmlTextData"),a(t)}}}],91:pP,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return mW(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},pc],93:pI,95:po,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,a=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),a++,t):(e.exit("codeTextSequence"),s(n))}(t)};function s(l){return null===l?n(l):32===l?(e.enter("space"),e.consume(l),e.exit("space"),s):96===l?(i=e.enter("codeTextSequence"),r=0,function n(s){return 96===s?(e.consume(s),r++,n):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(s)):(i.type="codeTextData",o(s))}(l)):mW(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):(e.enter("codeTextData"),o(l))}function o(t){return null===t||32===t||96===t||mW(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),o)}}}}],19210);var pU=e.i(19210);let pZ=/[\0\t\n\r]/g;function pF(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let pB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pV(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return pF(n.slice(t?2:1),t?16:10)}return pm(n)||e}let pq={}.hasOwnProperty;function pW(e){return{line:e.line,column:e.column,offset:e.offset}}function pH(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+mm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mm({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+mm({start:t.start,end:t.end})+") is still open")}function pG(e){let t=this;t.parser=function(n){var r,i;let a,s,o,l;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:d,autolinkEmail:d,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:d,characterReference:d,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:d,data:d,codeFlowValue:d,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(h),hardBreakTrailing:r(h),htmlFlow:r(g,i),htmlFlowData:d,htmlText:r(g,i),htmlTextData:d,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:s(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=pF(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=pm(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=pW(e.end)},codeFenced:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:s(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pj(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(u),hardBreakTrailing:s(u),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(pB,pV),n.identifier=pj(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=pW(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(d.call(this,e),c.call(this,e))},link:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:s(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:s(),thematicBreak:s()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(pq.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},s={stack:[r],tokenStack:[],config:t,enter:a,exit:o,buffer:i,resume:l,data:n},d=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?d.push(c):c=function(e,t,n){let r,i,a,s,o=t-1,l=-1,d=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,s=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||s||l||a||(a=o),s=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:s=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=o;for(i=void 0;s--;){let t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",d=!0),t[1].type="lineEnding",i=s}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}a&&(!i||a<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(o,0,["enter",i,t[2]]),o++,n++,a=void 0,s=!0}}}return e[t][1]._spread=d,n}(e,d.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];pq.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},s),e[c][1])}if(s.tokenStack.length>0){let e=s.tokenStack[s.tokenStack.length-1];(e[1]||pH).call(s,void 0,e[0])}for(r.position={start:pW(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:pW(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:pW(t.start),end:void 0}}function s(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||pH).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+mm({start:e.start,end:e.end})+"): it’s not open");n.position.end=pW(e.end)}function l(){return mT(this.stack.pop())}function d(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:pW(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=pW(e.end)}function u(){this.data.atHardBreak=!0}function m(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function h(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!m6(e););return e}((function(e){let t={constructs:mD([pU,...(e||{}).extensions||[]]),content:n(mQ),defined:[],document:n(m0),flow:n(m8),lazy:{},string:n(pe),text:n(pt)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],s=[],o=[],l={attempt:f(function(e,t){h(e,t.from)}),check:f(p),consume:function(e){mW(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=m(),d.events.push(["enter",n,d]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=m(),d.events.push(["exit",t,d]),t},interrupt:f(p,{interrupt:!0})},d={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:m,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let a,s=e[r];if("string"==typeof s)a=s;else switch(s){case -5:a="\r";break;case -4:a="\n";break;case -3:a="\r\n";break;case -2:a=t?" ":" ";break;case -1:if(!t&&n)continue;a=" ";break;default:a=String.fromCharCode(s)}n=-2===s,i.push(a)}return i.join("")}(u(e),t)},sliceStream:u,write:function(e){return(s=mM(s,e),function(){let e;for(;r._index<s.length;){let n=s[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==s[s.length-1])?[]:(h(t,0),d.events=ps(a,d.events,d),d.events)}},c=t.tokenize.call(d,l);return t.resolveAll&&a.push(t),d;function u(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;if(r===a)n=[e[r].slice(i,s)];else{if(n=e.slice(r,a),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}s>0&&n.push(e[a].slice(0,s))}return n}(s,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function p(e,t){t.restore()}function f(e,t){return function(n,i,a){var s;let c,u,p,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):(s=n,function(e){let t=null!==e&&s[e],n=null!==e&&s.null;return h([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function h(e){return(c=e,u=0,0===e.length)?a:x(e[u])}function x(e){return function(n){let i,a,s,c,u;return(i=m(),a=d.previous,s=d.currentConstruct,c=d.events.length,u=Array.from(o),f={from:c,restore:function(){r=i,d.previous=a,d.currentConstruct=s,d.events.length=c,o=u,g()}},p=e,e.partial||(d.currentConstruct=e),e.name&&d.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(d),t):d,l,v,y)(n)}}function v(t){return e(p,f),i}function y(e){return(f.restore(),++u<c.length)?x(c[u]):a}}}function h(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&mO(d.events,t,d.events.length-t,e.resolve(d.events.slice(t),d)),e.resolveTo&&(d.events=e.resolveTo(d.events,d))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((s=1,o="",l=!0,function(e,t,n){let r,i,d,c,u,m=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),d=0,o="",l&&(65279===e.charCodeAt(0)&&d++,l=void 0);d<e.length;){if(pZ.lastIndex=d,c=(r=pZ.exec(e))&&void 0!==r.index?r.index:e.length,u=e.charCodeAt(c),!r){o=e.slice(d);break}if(10===u&&d===c&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),d<c&&(m.push(e.slice(d,c)),s+=c-d),u){case 0:m.push(65533),s++;break;case 9:for(i=4*Math.ceil(s/4),m.push(-2);s++<i;)m.push(-1);break;case 10:m.push(-4),s=1;break;default:a=!0,s=1}d=c+1}return n&&(a&&m.push(-5),o&&m.push(o),m.push(null)),m})(n,r,!0))))}}let pK="object"==typeof self?self:globalThis,pJ=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+e)}return new pK[e](t)},pY=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[a,s]=e[i];switch(a){case 0:case -1:return n(s,i);case 1:{let e=n([],i);for(let t of s)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of s)e[r(t)]=r(n);return e}case 3:return n(new Date(s),i);case 4:{let{source:e,flags:t}=s;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of s)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of s)e.add(r(t));return e}case 7:{let{name:e,message:t}=s;return n(pJ(e,t),i)}case 8:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return n(new DataView(e),s)}}return n(pJ(a,s),i)})(0)},{toString:pX}={},{keys:pQ}=Object,p0=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=pX.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},p1=([e,t])=>0===e&&("function"===t||"symbol"===t),p2=(e,{json:t,lossy:n}={})=>{var r,i,a;let s,o,l=[];return(r=!(t||n),i=!!t,a=new Map,s=(e,t)=>{let n=l.push(e)-1;return a.set(t,n),n},o=e=>{if(a.has(e))return a.get(e);let[t,n]=p0(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return s([-1],e)}return s([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),s([n,[...t]],e)}let r=[],i=s([t,r],e);for(let t of e)r.push(o(t));return i}case 2:{if(n)switch(n){case"BigInt":return s([n,e.toString()],e);case"Boolean":case"Number":case"String":return s([n,e.valueOf()],e)}if(i&&"toJSON"in e)return o(e.toJSON());let a=[],l=s([t,a],e);for(let t of pQ(e))(r||!p1(p0(e[t])))&&a.push([o(t),o(e[t])]);return l}case 3:return s([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return s([t,{source:n,flags:r}],e)}case 5:{let n=[],i=s([t,n],e);for(let[t,i]of e)(r||!(p1(p0(t))||p1(p0(i))))&&n.push([o(t),o(i)]);return i}case 6:{let n=[],i=s([t,n],e);for(let t of e)(r||!p1(p0(t)))&&n.push(o(t));return i}}let{message:l}=e;return s([t,{name:n,message:l}],e)})(e),l},p4="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?pY(p2(e,t)):structuredClone(e):(e,t)=>pY(p2(e,t));function p5(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),s="";if(37===a&&mU(e.charCodeAt(n+1))&&mU(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(s=String.fromCharCode(a,t),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function p6(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function p3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let p9=function(e){var t,n;if(null==e)return p7;if("function"==typeof e)return p8(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=p9(e[n]);return p8(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,p8(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,p8(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function p8(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function p7(){return!0}let fe=[];function ft(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let a=p9(i),s=r?-1:1;(function e(i,o,l){let d=i&&"object"==typeof i?i:{};if("string"==typeof d.type){let e="string"==typeof d.tagName?d.tagName:"string"==typeof d.name?d.name:void 0;Object.defineProperty(c,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return c;function c(){var d;let c,u,m,p=fe;if((!t||a(i,o,l[l.length-1]||void 0))&&!1===(p=Array.isArray(d=n(i,l))?d:"number"==typeof d?[!0,d]:null==d?fe:[d])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(u=(r?i.children.length:-1)+s,m=l.concat(i);u>-1&&u<i.children.length;){if(!1===(c=e(i.children[u],u,m)())[0])return c;u="number"==typeof c[1]?c[1]:u+s}return p}})(e,void 0,[])()}function fn(e,t,n,r){let i,a,s;"function"==typeof t&&"function"!=typeof n?(a=void 0,s=t,i=n):(a=t,s=n,i=r),ft(e,a,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return s(e,r,n)},i)}function fr(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),a=i[0];a&&"text"===a.type?a.value="["+a.value:i.unshift({type:"text",value:"["});let s=i[i.length-1];return s&&"text"===s.type?s.value+=r:i.push({type:"text",value:r}),i}function fi(e){let t=e.spread;return null==t?e.children.length>1:t}function fa(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let fs={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=p5(i.toLowerCase()),s=e.footnoteOrder.indexOf(i),o=e.footnoteCounts.get(i);void 0===o?(o=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=s+1,o+=1,e.footnoteCounts.set(i,o);let l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,l);let d={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,d),e.applyData(t,d)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fr(e,t);let i={src:p5(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){let n={src:p5(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fr(e,t);let i={href:p5(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){let n={href:p5(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=fi(n[r])}return t}(n):fi(t),a={},s=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(i||0!==o||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?s.push(e):s.push(...e.children)}let l=r[r.length-1];l&&(i||"element"!==l.type||"p"!==l.tagName)&&s.push({type:"text",value:"\n"});let d={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,d),e.applyData(t,d)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=mc(t.children[1]),s=md(t.children[t.children.length-1]);a&&s&&(r.position={start:a,end:s}),i.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,s=a?a.length:t.children.length,o=-1,l=[];for(;++o<s;){let n=t.children[o],r={},s=a?a[o]:void 0;s&&(r.align=s);let d={type:"element",tagName:i,properties:r,children:[]};n&&(d.children=e.all(n),e.patch(n,d),d=e.applyData(n,d)),l.push(d)}let d={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,d),e.applyData(t,d)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(fa(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(fa(t.slice(i),i>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:fo,yaml:fo,definition:fo,footnoteDefinition:fo};function fo(){}let fl={}.hasOwnProperty,fd={};function fc(e,t){e.position&&(t.position=function(e){let t=mc(e),n=md(e);if(t&&n)return{start:t,end:n}}(e))}function fu(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,p4(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function fm(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function fp(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ff(e,t){let n,r,i,a,s=(n=t||fd,r=new Map,i=new Map,a={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=fp(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=fp(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:fu,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...fs,...n.handlers},one:function(e,t){let n=e.type,r=a.handlers[n];if(fl.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=p4(n);return r.children=a.all(e),r}return p4(e)}return(a.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(fl.call(n,"hProperties")||fl.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(a,e,t)},options:n,patch:fc,wrap:fm},fn(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a),o=s.one(e,void 0),l=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||p6,r=e.options.footnoteBackLabel||p3,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],l=-1;for(;++l<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;let a=e.all(i),s=String(i.identifier).toUpperCase(),d=p5(s.toLowerCase()),c=0,u=[],m=e.footnoteCounts.get(s);for(;void 0!==m&&++c<=m;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else a.push(...u);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(a,!0)};e.patch(i,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...p4(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(s),d=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return l&&(uA("children"in d),d.children.push({type:"text",value:"\n"},l)),d}function fh(e,t){return e&&"run"in e?async function(n,r){let i=ff(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ff(n,{file:r,...e||t})}}function fg(e){if(e)throw e}var fx=e.i(75609);function fv(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let fy=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');fw(e);let r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else s<0&&(n=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(i=a):(o=-1,i=s));return r===i?i=s:i<0&&(i=e.length),e.slice(r,i)},fb=function(e){let t;if(fw(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},fk=function(e){let t;fw(e);let n=e.length,r=-1,i=0,a=-1,s=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?a<0?a=n:1!==s&&(s=1):a>-1&&(s=-1)}return a<0||r<0||0===s||1===s&&a===r-1&&a===i+1?"":e.slice(a,r)},fj=function(...e){var t;let n,r,i,a=-1;for(;++a<e.length;)fw(e[a]),e[a]&&(i=void 0===i?e[a]:i+"/"+e[a]);return void 0===i?".":(fw(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",a=0,s=-1,o=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else if(47===n)break;else n=47;if(47===n){if(s===l-1||1===o);else if(s!==l-1&&2===o){if(i.length<2||2!==a||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",a=0):a=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),s=l,o=0;continue}}else if(i.length>0){i="",a=0,s=l,o=0;continue}}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,l):i=e.slice(s+1,l),a=l-s-1;s=l,o=0}else 46===n&&o>-1?o++:o=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function fw(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function fN(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let f_=["history","path","basename","stem","extname","dirname"];class fS{constructor(e){let t,n;t=e?fN(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<f_.length;){const e=f_[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)f_.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?fy(this.path):void 0}set basename(e){fI(e,"basename"),f$(e,"basename"),this.path=fj(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?fb(this.path):void 0}set dirname(e){fE(this.basename,"dirname"),this.path=fj(e||"",this.basename)}get extname(){return"string"==typeof this.path?fk(this.path):void 0}set extname(e){if(f$(e,"extname"),fE(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=fj(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){fN(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!fN(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),fI(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?fy(this.path,this.extname):void 0}set stem(e){fI(e,"stem"),f$(e,"stem"),this.path=fj(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new mg(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function f$(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function fI(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function fE(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let fC=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},fA={}.hasOwnProperty;class fT extends fC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(a,...s){let o=e[++n],l=-1;if(a)return void r(a);for(;++l<t.length;)(null===s[l]||void 0===s[l])&&(s[l]=t[l]);t=s,o?(function(e,t){let n;return function(...t){let a,s=e.length>t.length;s&&t.push(r);try{a=e.apply(this,t)}catch(e){if(s&&n)throw e;return r(e)}s||(a&&a.then&&"function"==typeof a.then?a.then(i,r):a instanceof Error?r(a):i(a))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(o,i)(...s):r(null,...s)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new fT,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,fx.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(fM("data",this.frozen),this.namespace[e]=t,this):fA.call(this.namespace,e)&&this.namespace[e]||void 0:e?(fM("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=fL(e),n=this.parser||this.Parser;return fz("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fz("process",this.parser||this.Parser),fO("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=fL(e),s=n.parse(a);function o(e,n){e||!n?i(e):r?r(n):(uA(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(s,a,function(e,t,r){var i,a;if(e||!t||!r)return o(e);let s=n.stringify(t,r);"string"==typeof(i=s)||(a=i)&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=s:r.result=s,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),fz("processSync",this.parser||this.Parser),fO("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,fg(e),t=r}),fD("processSync","process",n),uA(t,"we either bailed on an error or have a tree"),t}run(e,t,n){fR(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){uA("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let s=fL(t);r.run(e,s,function(t,r,s){let o=r||e;t?a(t):i?i(o):(uA(n,"`done` is defined if `resolve` is not"),n(void 0,o,s))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){fg(e),n=t,r=!0}),fD("runSync","run",r),uA(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=fL(t),r=this.compiler||this.Compiler;return fO("stringify",r),fR(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(fM("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else if("object"==typeof e)Array.isArray(e)?a(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=(0,fx.default)(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)s(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,s=n[i][1];fv(s)&&fv(r)&&(r=(0,fx.default)(!0,s,r)),n[i]=[e,r,...a]}}}}let fP=new fT().freeze();function fz(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function fO(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function fM(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fR(e){if(!fv(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function fD(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function fL(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new fS(e)}let fU=[],fZ={allowDangerousHtml:!0},fF=/^(https?|ircs?|mailto|xmpp)$/i,fB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fV(e){var t;let n,r,i,a,s,o=(n=(t=e).rehypePlugins||fU,r=t.remarkPlugins||fU,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...fZ}:fZ,fP().use(pG).use(r).use(fh,i).use(n)),l=(a=e.children||"",s=new fS,"string"==typeof a?s.value=a:uT("Unexpected value `"+a+"` for `children` prop, expected `string`"),s);return function(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||fq;for(let e of fB)Object.hasOwn(t,e.from)&&uT("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return n&&a&&uT("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),fn(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return s?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in mC)if(Object.hasOwn(mC,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=mC[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let s=n?!n.includes(e.tagName):!!a&&a.includes(e.tagName);if(!s&&r&&"number"==typeof t&&(s=!r(e,t,i)),s&&i&&"number"==typeof t)return o&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}),function(e,t){var n,r,i,a;let s;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,s=function(e,t,i,a){let s=Array.isArray(i.children),o=mc(e);return r(t,i,a,s,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,a=t.jsxs,s=function(e,t,n,r){let s=Array.isArray(n.children)?a:i;return r?s(t,n,r):s(t,n)}}let l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?mo:ms,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},d=mw(l,e,void 0);return d&&"string"!=typeof d?d:l.create(e,l.Fragment,{children:d||void 0},void 0)}(e,{Fragment:eT.Fragment,components:i,ignoreInvalidStyle:!0,jsx:eT.jsx,jsxs:eT.jsxs,passKeys:!0,passNode:!0})}(o.runSync(o.parse(l),l),e)}function fq(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||fF.test(e.slice(0,t))?e:""}function fW(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let fH="phrasing",fG=["autolink","link","image","label"];function fK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function fJ(e){this.config.enter.autolinkProtocol.call(this,e)}function fY(e){this.config.exit.autolinkProtocol.call(this,e)}function fX(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];uA("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function fQ(e){this.config.exit.autolinkEmail.call(this,e)}function f0(e){this.exit(e)}function f1(e){!function(e,t,n){let r=p9((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),a=-1;for(;++a<i.length;)ft(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){let e=t[s],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[a][0],s=i[a][1],o=0,l=n.children.indexOf(e),d=!1,c=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){let n=u.index,i={index:u.index,input:u.input,stack:[...t,e]},a=s(...u,i);if("string"==typeof a&&(a=a.length>0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(o!==n&&c.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(a)?c.push(...a):a&&c.push(a),o=n+u[0].length,d=!0),!r.global)break;u=r.exec(e.value)}return d?(o<e.value.length&&c.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...c)):c=[e],l+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,f2],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,f4]],{ignore:["link","linkReference"]})}function f2(e,t,n,r,i){let a,s="";if(!f5(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",s="http://"),(a=n.split(".")).length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))return!1;let o=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=fW(e,"("),a=fW(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),a++;return[e,n]}(n+r);if(!o[0])return!1;let l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function f4(e,t,n,r){return!(!f5(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function f5(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||mJ(n)||mK(n))&&(!t||47!==n)}function f6(){this.buffer()}function f3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function f9(){this.buffer()}function f8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function f7(e){let t=this.resume(),n=this.stack[this.stack.length-1];uA("footnoteReference"===n.type),n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function he(e){this.exit(e)}function ht(e){let t=this.resume(),n=this.stack[this.stack.length-1];uA("footnoteDefinition"===n.type),n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hn(e){this.exit(e)}function hr(e,t,n,r){let i=n.createTracker(r),a=i.move("[^"),s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]")}function hi(e,t,n){return 0===t?e:ha(e,t,n)}function ha(e,t,n){return(n?"":" ")+e}hr.peek=function(){return"["};let hs=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function ho(e){this.enter({type:"delete",children:[]},e)}function hl(e){this.exit(e)}function hd(e,t,n,r){let i=n.createTracker(r),a=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function hc(e){return e.length}function hu(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}hd.peek=function(){return"~"};function hm(e,t,n){let r=e.value||"",i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){let e,t=n.unsafe[a],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}hm.peek=function(){return"`"};p9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let hp=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),a=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(a=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let s=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));let o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);let l=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?a:a+" ".repeat(s-a.length))+e});return l(),d};function hf(e){let t=e._align;uA(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function hh(e){this.exit(e),this.data.inTable=void 0}function hg(e){this.enter({type:"tableRow",children:[]},e)}function hx(e){this.exit(e)}function hv(e){this.enter({type:"tableCell",children:[]},e)}function hy(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,hb));let n=this.stack[this.stack.length-1];uA("inlineCode"===n.type),n.value=t,this.exit(e)}function hb(e,t){return"|"===t?t:e}function hk(e){let t=this.stack[this.stack.length-2];uA("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function hj(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];uA("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,a=-1;for(;++a<i.length;){let e=i[a];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hw(e,t,n,r){let i=e.children[0],a="boolean"==typeof e.checked&&i&&"paragraph"===i.type,s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let l=hp(e,t,n,{...r,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}let hN={tokenize:function(e,t,n){let r=0;return function t(a){return(87===a||119===a)&&r<3?(r++,e.consume(a),t):46===a&&3===r?(e.consume(a),i):n(a)};function i(e){return null===e?n(e):t(e)}},partial:!0},h_={tokenize:function(e,t,n){let r,i,a;return s;function s(t){return 46===t||95===t?e.check(h$,l,o)(t):null===t||mH(t)||mJ(t)||45!==t&&mK(t)?l(t):(a=!0,e.consume(t),s)}function o(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),s}function l(e){return i||r||!a?n(e):t(e)}},partial:!0},hS={tokenize:function(e,t){let n=0,r=0;return i;function i(s){return 40===s?(n++,e.consume(s),i):41===s&&r<n?a(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(h$,t,a)(s):null===s||mH(s)||mJ(s)?t(s):(e.consume(s),i)}function a(t){return 41===t&&r++,e.consume(t),i}},partial:!0},h$={tokenize:function(e,t,n){return r;function r(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),r):38===s?(e.consume(s),a):93===s?(e.consume(s),i):60===s||null===s||mH(s)||mJ(s)?t(s):n(s)}function i(e){return null===e||40===e||91===e||mH(e)||mJ(e)?t(e):r(e)}function a(t){return mL(t)?function t(i){return 59===i?(e.consume(i),r):mL(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},hI={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return mU(e)?n(e):t(e)}},partial:!0},hE={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!hz.call(r,r.previous)||hD(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hN,e.attempt(h_,e.attempt(hS,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:hz},hC={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",a=!1;return function(t){return(72===t||104===t)&&hO.call(r,r.previous)&&!hD(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),s):n(t)};function s(t){if(mL(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),a)?l:(a=!0,o):n(t)}function l(t){return null===t||mF(t)||mH(t)||mJ(t)||mK(t)?n(t):e.attempt(h_,e.attempt(hS,d),n)(t)}function d(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:hO},hA={name:"emailAutolink",tokenize:function(e,t,n){let r,i,a=this;return function(t){return!hR(t)||!hM.call(a,a.previous)||hD(a.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return hR(r)?(e.consume(r),t):64===r?(e.consume(r),s):n(r)}(t))};function s(t){return 46===t?e.check(hI,l,o)(t):45===t||95===t||mU(t)?(i=!0,e.consume(t),s):l(t)}function o(t){return e.consume(t),r=!0,s}function l(s){return i&&r&&mL(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:hM},hT={},hP=48;for(;hP<123;)hT[hP]=hA,58==++hP?hP=65:91===hP&&(hP=97);function hz(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||mH(e)}function hO(e){return!mL(e)}function hM(e){return!(47===e||hR(e))}function hR(e){return 43===e||45===e||46===e||95===e||mU(e)}function hD(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}hT[43]=hA,hT[45]=hA,hT[46]=hA,hT[95]=hA,hT[72]=[hA,hC],hT[104]=[hA,hC],hT[87]=[hA,hE],hT[119]=[hA,hE];let hL={tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function hU(e,t,n){let r,i=this,a=i.events.length,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;a--;){let e=i.events[a][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(a){if(!r||!r._balanced)return n(a);let o=pj(i.sliceSerialize({start:r.end,end:i.now()}));return 94===o.codePointAt(0)&&s.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a)):n(a)}}function hZ(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function hF(e,t,n){let r,i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(s>999||93===o&&!r||null===o||91===o||mH(o))return n(o);if(93===o){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return a.includes(pj(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return mH(o)||(r=!0),s++,e.consume(o),92===o?d:l}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function hB(e,t,n){let r,i,a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(t)}function d(t){if(o>999||93===t&&!i||null===t||91===t||mH(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=pj(a.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return mH(t)||(i=!0),o++,e.consume(t),92===t?c:d}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,d):d(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(r)||s.push(r),mX(e,m,"gfmFootnoteDefinitionWhitespace")):n(t)}function m(e){return t(e)}}function hV(e,t,n){return e.check(m2,t,e.attempt(hL,t,n))}function hq(e){e.exit("gfmFootnoteDefinition")}class hW{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function hH(e,t,n){let r,i=this,a=0,s=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,a="tableHead"===r||"tableRow"===r?v:o;return a===v&&i.parser.lazy[i.now().line]?n(e):a(e)};function o(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,s+=1),l(n)}function l(t){return null===t?n(t):mW(t)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):mG(t)?mX(e,l,"whitespace")(t):(s+=1,r&&(r=!1,a+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l):(e.enter("data"),d(t))}function d(t){return null===t||124===t||mH(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?c:d)}function c(t){return 92===t||124===t?(e.consume(t),d):d(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,mG(t))?mX(e,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):m(t)}function m(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return mG(t)?mX(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(s+=1,h(t)):null===t||mW(t)?x(t):n(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return mG(t)?mX(e,x,"whitespace")(t):x(t)}function x(i){if(124===i)return m(i);if(null===i||mW(i))return r&&a===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function v(t){return e.enter("tableRow"),y(t)}function y(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),y):null===n||mW(n)?(e.exit("tableRow"),t(n)):mG(n)?mX(e,y,"whitespace")(n):(e.enter("data"),b(n))}function b(t){return null===t||124===t||mH(t)?(e.exit("data"),y(t)):(e.consume(t),92===t?k:b)}function k(t){return 92===t||124===t?(e.consume(t),b):b(t)}}function hG(e,t){let n,r,i,a=-1,s=!0,o=0,l=[0,0,0,0],d=[0,0,0,0],c=!1,u=0,m=new hW;for(;++a<e.length;){let p=e[a],f=p[1];"enter"===p[0]?"tableHead"===f.type?(c=!1,0!==u&&(hJ(m,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,i=void 0,l=[0,0,0,0],d=[0,a+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(s=!1,0===d[2]&&(0!==l[1]&&(d[0]=d[1],i=hK(m,t,l,o,void 0,i),l=[0,0,0,0]),d[2]=a)):"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(d[0]=d[1],i=hK(m,t,l,o,void 0,i)),d=[(l=d)[1],a,0,0])):"tableHead"===f.type?(c=!0,u=a):"tableRow"===f.type||"tableDelimiterRow"===f.type?(u=a,0!==l[1]?(d[0]=d[1],i=hK(m,t,l,o,a,i)):0!==d[1]&&(i=hK(m,t,d,o,a,i)),o=0):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(d[3]=a)}for(0!==u&&hJ(m,t,u,n,r),m.consume(t.events),a=-1;++a<t.events.length;){let e=t.events[a];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,a))}return e}function hK(e,t,n,r,i,a){0!==n[0]&&(a.end=Object.assign({},hY(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));let s=hY(t.events,n[1]);if(a={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",a,t]]),0!==n[2]){let i=hY(t.events,n[2]),a=hY(t.events,n[3]),s={type:"tableContent",start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[["enter",s,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==i&&(a.end=Object.assign({},hY(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function hJ(e,t,n,r,i){let a=[],s=hY(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function hY(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let hX={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return mH(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return mW(r)?t(r):mG(r)?e.check({tokenize:hQ},t,n)(r):n(r)}}};function hQ(e,t,n){return mX(e,function(e){return null===e?n(e):t(e)},"whitespace")}let h0={};function h1(e){let t,n,r,i=e||h0,a=this.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),l=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(mD([{text:hT},{document:{91:{name:"gfmFootnoteDefinition",tokenize:hB,continuation:{tokenize:hV},exit:hq}},text:{91:{name:"gfmFootnoteCall",tokenize:hF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hU,resolveTo:hZ}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,a=this.events,s=0;return function(o){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(o):(e.enter("strikethroughSequenceTemporary"),function a(o){let l=pa(i);if(126===o)return s>1?r(o):(e.consume(o),s++,a);if(s<2&&!t)return r(o);let d=e.exit("strikethroughSequenceTemporary"),c=pa(o);return d._open=!c||2===c&&!!l,d._close=!l||2===l&&!!c,n(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",a,t]],o=t.parser.constructs.insideSpan.null;o&&mO(s,s.length,0,ps(o,e.slice(r+1,n),t)),mO(s,s.length,0,[["exit",a,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),mO(e,r-1,n-r+3,s),n=r+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:hH,resolveAll:hG}}},{text:{91:hX}}])),o.push([{transforms:[f1],enter:{literalAutolink:fK,literalAutolinkEmail:fJ,literalAutolinkHttp:fJ,literalAutolinkWww:fJ},exit:{literalAutolink:f0,literalAutolinkEmail:fQ,literalAutolinkHttp:fY,literalAutolinkWww:fX}},{enter:{gfmFootnoteCallString:f6,gfmFootnoteCall:f3,gfmFootnoteDefinitionLabelString:f9,gfmFootnoteDefinition:f8},exit:{gfmFootnoteCallString:f7,gfmFootnoteCall:he,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:hn}},{canContainEols:["delete"],enter:{strikethrough:ho},exit:{strikethrough:hl}},{enter:{table:hf,tableData:hv,tableHeader:hv,tableRow:hg},exit:{codeText:hy,table:hh,tableData:hx,tableHeader:hx,tableRow:hx}},{exit:{taskListCheckValueChecked:hk,taskListCheckValueUnchecked:hk,paragraph:hj}}]),l.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fH,notInConstruct:fG},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fH,notInConstruct:fG},{character:":",before:"[ps]",after:"\\/",inConstruct:fH,notInConstruct:fG}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let a=n.createTracker(i),s=a.move("[^"),o=n.enter("footnoteDefinition"),l=n.enter("label");return s+=a.move(n.safe(n.associationId(e),{before:s,after:"]"})),l(),s+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),s+=a.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,a.current()),r?ha:hi))),o(),s},footnoteReference:hr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hs}],handlers:{delete:hd}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=hm(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){let r=e.children,i=-1,a=[],s=t.enter("table");for(;++i<r.length;)a[i]=l(r[i],t,n);return s(),a}(e,n,r),e.align)},tableCell:s,tableRow:function(e,t,n,r){let i=o([l(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function s(e,t,n,r){let i=n.enter("tableCell"),s=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:a,after:a});return s(),i(),o}function o(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hc,a=[],s=[],o=[],l=[],d=0,c=-1;for(;++c<e.length;){let t=[],r=[],a=-1;for(e[c].length>d&&(d=e[c].length);++a<e[c].length;){var u;let s=null==(u=e[c][a])?"":String(u);if(!1!==n.alignDelimiters){let e=i(s);r[a]=e,(void 0===l[a]||e>l[a])&&(l[a]=e)}t.push(s)}s[c]=t,o[c]=r}let m=-1;if("object"==typeof r&&"length"in r)for(;++m<d;)a[m]=hu(r[m]);else{let e=hu(r);for(;++m<d;)a[m]=e}m=-1;let p=[],f=[];for(;++m<d;){let e=a[m],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,l[m]-t.length-r.length),s=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>l[m]&&(l[m]=i),f[m]=i),p[m]=s}s.splice(1,0,p),o.splice(1,0,f),c=-1;let h=[];for(;++c<s.length;){let e=s[c],t=o[c];m=-1;let r=[];for(;++m<d;){let i=e[m]||"",s="",o="";if(!1!==n.alignDelimiters){let e=l[m]-(t[m]||0),n=a[m];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=s=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||m||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||m)&&r.push(" "),!1!==n.alignDelimiters&&r.push(s),r.push(i),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||m!==d-1)&&r.push("|")}h.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return h.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function l(e,t,n){let r=e.children,i=-1,a=[],o=t.enter("tableRow");for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hw}}]})}function h2({className:e,children:t}){let[n,r]=(0,eP.useState)(!1),i=/language-(\w+)/.exec(e??"")?.[1],a=String(t).replace(/\n$/,"");return(0,eT.jsxs)("div",{className:"group relative my-3 overflow-hidden rounded-sm border border-border bg-background/70",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-card/60 px-3 py-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:i??"code"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(a).then(()=>{r(!0),window.setTimeout(()=>r(!1),1400)})},className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[n?(0,eT.jsx)(iq,{className:"size-3"}):(0,eT.jsx)(oC,{className:"size-3"}),n?"copied":"copy"]})]}),(0,eT.jsx)("pre",{className:"overflow-x-auto px-3 py-2.5 font-mono text-xs leading-relaxed text-foreground/90",children:(0,eT.jsx)("code",{children:a})})]})}let h4=(0,eP.memo)(function({children:e}){return(0,eT.jsx)("div",{className:"text-sm leading-relaxed text-foreground",children:(0,eT.jsx)(fV,{remarkPlugins:[h1],components:{p:({children:e})=>(0,eT.jsx)("p",{className:"mb-3 last:mb-0 text-pretty",children:e}),h1:({children:e})=>(0,eT.jsx)("h1",{className:"mb-2 mt-4 text-base font-semibold first:mt-0",children:e}),h2:({children:e})=>(0,eT.jsx)("h2",{className:"mb-2 mt-4 text-sm font-semibold first:mt-0",children:e}),h3:({children:e})=>(0,eT.jsx)("h3",{className:"mb-1.5 mt-3 text-sm font-semibold first:mt-0",children:e}),ul:({children:e})=>(0,eT.jsx)("ul",{className:"mb-3 ml-4 list-disc space-y-1 last:mb-0",children:e}),ol:({children:e})=>(0,eT.jsx)("ol",{className:"mb-3 ml-4 list-decimal space-y-1 last:mb-0",children:e}),li:({children:e})=>(0,eT.jsx)("li",{className:"text-pretty",children:e}),a:({href:e,children:t})=>(0,eT.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-foreground underline decoration-border underline-offset-2 transition-colors hover:decoration-foreground",children:t}),strong:({children:e})=>(0,eT.jsx)("strong",{className:"font-semibold text-foreground",children:e}),blockquote:({children:e})=>(0,eT.jsx)("blockquote",{className:"my-3 border-l-2 border-border pl-3 text-muted-foreground",children:e}),hr:()=>(0,eT.jsx)("hr",{className:"my-4 border-border"}),table:({children:e})=>(0,eT.jsx)("div",{className:"my-3 overflow-x-auto rounded-sm border border-border",children:(0,eT.jsx)("table",{className:"w-full border-collapse text-xs",children:e})}),th:({children:e})=>(0,eT.jsx)("th",{className:"border-b border-border bg-card px-2.5 py-1.5 text-left font-mono text-[11px] font-semibold",children:e}),td:({children:e})=>(0,eT.jsx)("td",{className:"border-b border-border px-2.5 py-1.5",children:e}),code:({className:e,children:t,...n})=>e?(0,eT.jsx)(h2,{className:e,children:t}):(0,eT.jsx)("code",{className:(0,ny.cn)("rounded-sm border border-border bg-background/70 px-1 py-0.5 font-mono text-[0.85em] text-foreground"),...n,children:t}),pre:({children:e})=>(0,eT.jsx)(eT.Fragment,{children:e})},children:e})})}),h5=e=>fetch(e).then(e=>e.json()),h6=[{id:"dashboard",label:"Dashboard",icon:cD},{id:"notes",label:"Release notes",icon:eZ},{id:"contributors",label:"Contributors",icon:uI},{id:"reactions",label:"Reactions",icon:uE},{id:"cadence",label:"Cadence",icon:u$},{id:"compare",label:"Compare",icon:uS}],h3=[{key:"plusOne",emoji:"👍",label:"+1"},{key:"minusOne",emoji:"👎",label:"-1"},{key:"laugh",emoji:"😄",label:"Laugh"},{key:"hooray",emoji:"🎉",label:"Hooray"},{key:"heart",emoji:"❤️",label:"Heart"},{key:"rocket",emoji:"🚀",label:"Rocket"},{key:"eyes",emoji:"👀",label:"Eyes"},{key:"confused",emoji:"😕",label:"Confused"}];function h9(e){return e.toLocaleString()}function h8(e){return e?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"—"}function h7(e,t){return Math.abs(new Date(e).getTime()-new Date(t).getTime())/864e5}function ge({icon:e,label:t,value:n,sub:r}){return(0,eT.jsxs)(s8,{className:"flex flex-row items-center gap-3 p-4",children:[(0,eT.jsx)("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-sm border border-border text-muted-foreground",children:(0,eT.jsx)(e,{className:"size-5"})}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),(0,eT.jsx)("p",{className:"truncate text-lg font-semibold tabular-nums text-foreground",children:n}),r&&(0,eT.jsx)("p",{className:"truncate font-mono text-[10px] text-muted-foreground",children:r})]})]})}function gt({release:e}){return(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.prerelease&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-medium)]/15 font-mono text-[10px] text-[color:var(--sev-medium)]",children:"pre-release"}),e.draft&&(0,eT.jsx)(nS,{className:"border-0 bg-secondary font-mono text-[10px] text-muted-foreground",children:"draft"})]})}function gn({releases:e}){let t=(0,eP.useMemo)(()=>{let t=e.filter(e=>e.publishedAt),n=e.reduce((e,t)=>e+t.totalDownloads,0),r=e.reduce((e,t)=>e+(t.reactions?.total??0),0),i=t.map(e=>e.publishedAt).sort((e,t)=>new Date(t).getTime()-new Date(e).getTime()),a=[];for(let e=0;e<i.length-1;e++)a.push(h7(i[e],i[e+1]));return{total:e.length,prereleases:e.filter(e=>e.prerelease).length,totalDownloads:n,totalReactions:r,latest:t[0]??e[0],medianGap:Math.round(function(e){if(0===e.length)return 0;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2}(a))}},[e]),n=(0,eP.useMemo)(()=>[...e].sort((e,t)=>t.totalDownloads-e.totalDownloads).slice(0,5),[e]);return(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,eT.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,eT.jsx)(ge,{icon:cM,label:"Releases",value:h9(t.total),sub:`${t.prereleases} pre-release`}),(0,eT.jsx)(ge,{icon:st,label:"Downloads",value:h9(t.totalDownloads),sub:"across all assets"}),(0,eT.jsx)(ge,{icon:uE,label:"Reactions",value:h9(t.totalReactions),sub:"community feedback"}),(0,eT.jsx)(ge,{icon:u$,label:"Median cadence",value:t.medianGap?`${t.medianGap}d`:"—",sub:"between releases"})]}),t.latest&&(0,eT.jsx)(oS,{title:"Latest release",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cD,{className:"size-4 text-[color:var(--sev-ok)]"}),(0,eT.jsx)("span",{className:"font-semibold text-foreground",children:t.latest.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:t.latest.tag}),(0,eT.jsx)(gt,{release:t.latest})]}),(0,eT.jsxs)("a",{href:t.latest.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"})," GitHub"]})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:h8(t.latest.publishedAt)}),t.latest.author&&(0,eT.jsxs)("span",{children:["by ",t.latest.author.login]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(st,{className:"size-3"})," ",h9(t.latest.totalDownloads)]})]})]})}),(0,eT.jsx)(oS,{title:"Most downloaded",children:n.every(e=>0===e.totalDownloads)?(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"No downloadable assets attached to releases."}):(0,eT.jsx)("div",{className:"flex flex-col gap-2.5",children:n.map(e=>{let t=n[0].totalDownloads||1,r=e.totalDownloads/t*100;return(0,eT.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:h9(e.totalDownloads)})]}),(0,eT.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${Math.max(r,2)}%`}})})]},e.id)})})})]})}function gr({releases:e}){let[t,n]=(0,eP.useState)(e[0]?.id??null),r=e.find(e=>e.id===t)??e[0];return r?(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[220px_1fr]",children:[(0,eT.jsx)("div",{className:"flex max-h-[60vh] flex-col gap-1 overflow-auto rounded-sm border border-border bg-card p-2",children:e.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.id),className:(0,ny.cn)("flex flex-col gap-0.5 rounded-sm px-2.5 py-2 text-left transition-colors",e.id===r.id?"bg-secondary":"hover:bg-secondary/50"),children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs font-medium text-foreground",children:e.tag}),(0,eT.jsx)("span",{className:"truncate text-[10px] text-muted-foreground",children:h8(e.publishedAt)})]},e.id))}),(0,eT.jsxs)(s8,{className:"min-w-0 p-5",children:[(0,eT.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2 border-b border-border pb-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("h3",{className:"text-base font-semibold text-foreground",children:r.name}),(0,eT.jsx)(gt,{release:r})]}),(0,eT.jsxs)("a",{href:r.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"})," View on GitHub"]})]}),r.assets.length>0&&(0,eT.jsx)("div",{className:"mb-4 flex flex-col gap-1.5",children:r.assets.map(e=>{var t;return(0,eT.jsxs)("div",{className:"flex items-center gap-2 rounded-sm border border-border px-2.5 py-1.5 font-mono text-[11px]",children:[(0,eT.jsx)(eq,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"shrink-0 text-muted-foreground",children:(t=e.size)<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:t<0x40000000?`${(t/1048576).toFixed(1)} MB`:`${(t/0x40000000).toFixed(2)} GB`}),(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(st,{className:"size-3"}),h9(e.downloadCount)]})]},e.name)})}),r.body.trim()?(0,eT.jsx)(h4,{children:r.body}):(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No release notes provided."})]})]}):null}function gi({releases:e}){let t=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e){if(!n.author)continue;let e=t.get(n.author.login)??{login:n.author.login,avatarUrl:n.author.avatarUrl,htmlUrl:n.author.htmlUrl,releases:0,downloads:0};e.releases+=1,e.downloads+=n.totalDownloads,t.set(n.author.login,e)}return[...t.values()].sort((e,t)=>t.releases-e.releases)},[e]);if(0===t.length)return(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No release authors found."});let n=t[0].releases;return(0,eT.jsx)("div",{className:"flex flex-col gap-2.5",children:t.map((e,t)=>(0,eT.jsxs)(s8,{className:"flex flex-row items-center gap-3 p-3",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-7 shrink-0 items-center justify-center rounded-full font-mono text-xs font-semibold",0===t?"bg-[color:var(--sev-medium)]/20 text-[color:var(--sev-medium)]":"bg-secondary text-muted-foreground"),children:t+1}),(0,eT.jsx)("img",{src:e.avatarUrl||"/placeholder.svg",alt:"",className:"size-9 shrink-0 rounded-full"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"truncate font-medium text-foreground hover:underline",children:e.login}),(0,eT.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${e.releases/n*100}%`}})})]}),(0,eT.jsxs)("div",{className:"shrink-0 text-right font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("p",{className:"text-foreground",children:[e.releases," releases"]}),(0,eT.jsxs)("p",{children:[h9(e.downloads)," downloads"]})]})]},e.login))})}function ga({releases:e}){let{totals:t,ranked:n}=(0,eP.useMemo)(()=>{let t={total:0,plusOne:0,minusOne:0,laugh:0,hooray:0,confused:0,heart:0,rocket:0,eyes:0};for(let n of e)if(n.reactions)for(let e of Object.keys(t))t[e]+=n.reactions[e];return{totals:t,ranked:e.filter(e=>(e.reactions?.total??0)>0).sort((e,t)=>(t.reactions?.total??0)-(e.reactions?.total??0)).slice(0,8)}},[e]);if(0===t.total)return(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(uE,{className:"size-5 text-muted-foreground"}),"No reactions on releases yet."]});let r=Math.max(...h3.map(e=>t[e.key]));return(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,eT.jsx)(oS,{title:`Community reactions (${h9(t.total)})`,children:(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:h3.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("span",{className:"w-6 text-center text-base","aria-hidden":!0,children:e.emoji}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,eT.jsx)("span",{className:"tabular-nums text-foreground",children:h9(t[e.key])})]}),(0,eT.jsx)("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${r?t[e.key]/r*100:0}%`}})})]})]},e.key))})}),n.length>0&&(0,eT.jsx)(oS,{title:"Most-loved releases",children:(0,eT.jsx)("div",{className:"flex flex-col divide-y divide-border",children:n.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-3 py-2.5 first:pt-0 last:pb-0",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.tag}),(0,eT.jsx)("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:h3.filter(t=>(e.reactions?.[t.key]??0)>0).map(t=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,eT.jsx)("span",{"aria-hidden":!0,children:t.emoji}),e.reactions?.[t.key]]},t.key))})]},e.id))})})]})}function gs({releases:e}){let{years:t,months:n,grid:r,max:i}=(0,eP.useMemo)(()=>{let t=new Map,n=1/0,r=-1/0;for(let i of e){if(!i.publishedAt)continue;let e=new Date(i.publishedAt),a=e.getFullYear(),s=e.getMonth();t.set(`${a}-${s}`,(t.get(`${a}-${s}`)??0)+1),n=Math.min(n,a),r=Math.max(r,a)}let i=[];if(Number.isFinite(n))for(let e=r;e>=n;e--)i.push(e);let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],s=Math.max(1,...t.values()),o=i.map(e=>({year:e,cells:a.map((n,r)=>t.get(`${e}-${r}`)??0)}));return{years:i,months:a,grid:o,max:s}},[e]);return 0===t.length?(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No published releases to chart."}):(0,eT.jsx)(oS,{title:"Release cadence",children:(0,eT.jsx)("div",{className:"overflow-x-auto",children:(0,eT.jsxs)("div",{className:"min-w-[520px]",children:[(0,eT.jsxs)("div",{className:"mb-1 grid grid-cols-[40px_repeat(12,1fr)] gap-1",children:[(0,eT.jsx)("span",{}),n.map(e=>(0,eT.jsx)("span",{className:"text-center font-mono text-[10px] text-muted-foreground",children:e},e))]}),r.map(e=>(0,eT.jsxs)("div",{className:"mb-1 grid grid-cols-[40px_repeat(12,1fr)] items-center gap-1",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.year}),e.cells.map((t,r)=>(0,eT.jsx)("div",{title:`${n[r]} ${e.year}: ${t} release${1===t?"":"s"}`,className:(0,ny.cn)("aspect-square rounded-sm",function(e){if(0===e)return"bg-secondary";let t=e/i;return t>.66?"bg-primary":t>.33?"bg-primary/60":"bg-primary/30"}(t))},r))]},e.year)),(0,eT.jsxs)("div",{className:"mt-3 flex items-center justify-end gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:"less"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-secondary"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary/30"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary/60"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary"}),(0,eT.jsx)("span",{children:"more"})]})]})})})}function go({releases:e}){let[t,n]=(0,eP.useState)(e[1]?.id??e[0]?.id??null),[r,i]=(0,eP.useState)(e[0]?.id??null),a=e.find(e=>e.id===t),s=e.find(e=>e.id===r);function o({value:t,onChange:n}){return(0,eT.jsx)("select",{value:t??"",onChange:e=>n(Number(e.target.value)),className:"w-full rounded-sm border border-border bg-background px-2 py-1.5 font-mono text-xs text-foreground outline-none focus:border-foreground/30",children:e.map(e=>(0,eT.jsxs)("option",{value:e.id,children:[e.tag," — ",h8(e.publishedAt)]},e.id))})}function l({release:e}){return e?(0,eT.jsxs)(s8,{className:"flex min-w-0 flex-col gap-3 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border pb-2",children:[(0,eT.jsx)("span",{className:"truncate font-semibold text-foreground",children:e.name}),(0,eT.jsx)(gt,{release:e})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-2 font-mono text-[11px]",children:[(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Published"}),(0,eT.jsx)("dd",{className:"text-right text-foreground",children:h8(e.publishedAt)}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Author"}),(0,eT.jsx)("dd",{className:"truncate text-right text-foreground",children:e.author?.login??"—"}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Downloads"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:h9(e.totalDownloads)}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Assets"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:e.assets.length}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Reactions"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:h9(e.reactions?.total??0)})]}),(0,eT.jsx)("div",{className:"max-h-72 overflow-auto border-t border-border pt-3",children:e.body.trim()?(0,eT.jsx)(h4,{children:e.body}):(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"No notes."})})]}):(0,eT.jsx)(s8,{className:"p-5 text-sm text-muted-foreground",children:"Select a release."})}let d=(0,eP.useMemo)(()=>a&&s?{days:Math.round(h7(a.publishedAt??a.createdAt,s.publishedAt??s.createdAt)),downloads:s.totalDownloads-a.totalDownloads,reactions:(s.reactions?.total??0)-(a.reactions?.total??0)}:null,[a,s]);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid items-center gap-3 sm:grid-cols-[1fr_auto_1fr]",children:[(0,eT.jsx)(o,{value:t,onChange:n}),(0,eT.jsx)(uC,{className:"mx-auto size-4 rotate-90 text-muted-foreground sm:rotate-0"}),(0,eT.jsx)(o,{value:r,onChange:i})]}),d&&(0,eT.jsxs)(s8,{className:"grid grid-cols-3 divide-x divide-border p-0",children:[(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Time apart"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.days,"d"]})]}),(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Δ downloads"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.downloads>0?"+":"",h9(d.downloads)]})]}),(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Δ reactions"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.reactions>0?"+":"",h9(d.reactions)]})]})]}),(0,eT.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,eT.jsx)(l,{release:a}),(0,eT.jsx)(l,{release:s})]})]})}function gl({owner:e,repo:t}){let[n,r]=(0,eP.useState)("dashboard"),[i,a]=(0,eP.useState)(""),[s,o]=(0,eP.useState)("all"),{data:l,isLoading:d,error:c}=u_(e&&t?`/api/github/releases?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`:null,h5,{revalidateOnFocus:!1}),u=(0,eP.useMemo)(()=>l?.releases??[],[l]),m=(0,eP.useMemo)(()=>{let e=i.trim().toLowerCase();return u.filter(t=>("stable"!==s||!t.prerelease)&&("prerelease"!==s||!!t.prerelease)&&(!e||t.name.toLowerCase().includes(e)||t.tag.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||(t.author?.login.toLowerCase().includes(e)??!1)))},[u,i,s]);return d?(0,eT.jsxs)("div",{className:"flex items-center justify-center gap-2 py-16 font-mono text-sm text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"}),"Loading releases from GitHub…"]}):c||l?.error?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-5 text-[color:var(--sev-medium)]"}),l?.error??"Could not load releases from GitHub."]}):0===u.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(cM,{className:"size-5 text-muted-foreground"}),"This repository has no published releases."]}):(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:h6.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.id),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors",n===e.id?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-3.5"}),e.label]},e.id))}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:i,onChange:e=>a(e.target.value),placeholder:"Search tag, title, notes, author…",className:"w-full rounded-sm border border-border bg-background py-2 pl-9 pr-8 font-mono text-xs text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),i&&(0,eT.jsx)("button",{type:"button",onClick:()=>a(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(0,eT.jsx)("div",{className:"flex items-center gap-1.5",children:["all","stable","prerelease"].map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>o(e),className:(0,ny.cn)("rounded-sm border px-2.5 py-1.5 font-mono text-[11px] capitalize transition-colors",s===e?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:e},e))})]}),(0,eT.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[m.length," of ",u.length," releases"]}),0===m.length?(0,eT.jsx)(s8,{className:"p-6 text-center text-sm text-muted-foreground",children:"No releases match your search."}):(0,eT.jsxs)(eT.Fragment,{children:["dashboard"===n&&(0,eT.jsx)(gn,{releases:m}),"notes"===n&&(0,eT.jsx)(gr,{releases:m}),"contributors"===n&&(0,eT.jsx)(gi,{releases:m}),"reactions"===n&&(0,eT.jsx)(ga,{releases:m}),"cadence"===n&&(0,eT.jsx)(gs,{releases:m}),"compare"===n&&(0,eT.jsx)(go,{releases:m})]})]})}let gd=eL("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),gc=eL("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),gu=eL("scale",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]);function gm(e){return(0,eT.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",...e,children:(0,eT.jsx)("path",{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 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}let gp=e=>fetch(e).then(e=>e.json()),gf=["var(--primary)","var(--sev-ok)","var(--sev-medium)","var(--sev-info)","var(--sev-high)","var(--muted-foreground)"];function gh(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function gg({source:e,detected:t,onChange:n}){let[r,i]=(0,eP.useState)(!1),[a,s]=(0,eP.useState)(e?.owner??""),[o,l]=(0,eP.useState)(e?.repo??"");function d(){let e=a.trim(),t=o.trim().replace(/\.git$/,"");e&&t&&(n({owner:e,repo:t}),i(!1))}return r||!e?(0,eT.jsxs)(s8,{className:"flex flex-col gap-2 p-3 sm:flex-row sm:items-center",children:[(0,eT.jsx)(gm,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"flex flex-1 items-center gap-1.5 font-mono text-xs",children:[(0,eT.jsx)("input",{value:a,onChange:e=>s(e.target.value),placeholder:"owner",className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-2 py-1.5 text-foreground outline-none focus:border-foreground/30"}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:"/"}),(0,eT.jsx)("input",{value:o,onChange:e=>l(e.target.value),placeholder:"repo",onKeyDown:e=>"Enter"===e.key&&d(),className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-2 py-1.5 text-foreground outline-none focus:border-foreground/30"})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eT.jsxs)("button",{type:"button",onClick:d,className:"inline-flex items-center gap-1 rounded-sm bg-primary px-2.5 py-1.5 font-mono text-xs text-primary-foreground hover:bg-primary/90",children:[(0,eT.jsx)(iq,{className:"size-3.5"})," Load"]}),e&&(0,eT.jsx)("button",{type:"button",onClick:()=>i(!1),"aria-label":"Cancel",className:"inline-flex items-center rounded-sm border border-border px-2 py-1.5 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})}),t&&(t.owner!==a||t.repo!==o)&&(0,eT.jsx)("button",{type:"button",onClick:()=>{s(t.owner),l(t.repo),n(t),i(!1)},className:"font-mono text-[11px] text-muted-foreground underline hover:text-foreground",children:"reset to detected"})]})]}):(0,eT.jsxs)(s8,{className:"flex items-center justify-between gap-2 p-3",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,eT.jsx)(gm,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"truncate font-mono text-sm text-foreground",children:[e.owner,"/",e.repo]}),t&&t.owner===e.owner&&t.repo===e.repo&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"detected"})]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>i(!0),className:"inline-flex shrink-0 items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(l5,{className:"size-3"})," Change"]})]})}function gx({icon:e,label:t,value:n}){return(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums text-foreground",children:n}),(0,eT.jsx)("span",{className:"ml-1 font-mono text-[10px] text-muted-foreground",children:t})]})]})}function gv({source:e}){let{data:t,isLoading:n,error:r}=u_(`/api/github/repo?owner=${encodeURIComponent(e.owner)}&repo=${encodeURIComponent(e.repo)}`,gp,{revalidateOnFocus:!1});if(n)return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex items-center gap-2 py-3 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"})," Loading repository…"]})});if(r||t?.error||!t?.overview)return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2 py-1 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-3.5 shrink-0 text-[color:var(--sev-medium)]"}),t?.error??"Could not reach the GitHub API."]})});let i=t.overview,a=i.languages.reduce((e,t)=>e+t.bytes,0)||1;return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[i.description&&(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-foreground",children:i.description}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-2.5",children:[(0,eT.jsx)(gx,{icon:gd,label:"stars",value:gh(i.stars)}),(0,eT.jsx)(gx,{icon:cO,label:"forks",value:gh(i.forks)}),(0,eT.jsx)(gx,{icon:cv,label:"watchers",value:gh(i.subscribers)}),(0,eT.jsx)(gx,{icon:gc,label:"open issues",value:gh(i.openIssues)})]}),i.license&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-t border-border pt-3",children:[(0,eT.jsx)(gu,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:i.license})]}),i.languages.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border pt-3",children:[(0,eT.jsx)("div",{className:"flex h-2 overflow-hidden rounded-full",children:i.languages.slice(0,6).map((e,t)=>(0,eT.jsx)("div",{title:`${e.name} ${(e.bytes/a*100).toFixed(1)}%`,style:{width:`${e.bytes/a*100}%`,background:gf[t%gf.length]}},e.name))}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:i.languages.slice(0,4).map((e,t)=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"size-2 rounded-full",style:{background:gf[t%gf.length]},"aria-hidden":!0}),e.name]},e.name))})]}),i.contributors.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Top contributors"}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.contributors.slice(0,8).map(e=>(0,eT.jsx)("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",title:`${e.login} \xb7 ${e.contributions} commits`,children:(0,eT.jsx)("img",{src:e.avatarUrl||"/placeholder.svg",alt:e.login,className:"size-7 rounded-full ring-1 ring-border transition-transform hover:scale-110"})},e.login))})]}),(0,eT.jsxs)("a",{href:i.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:(0,ny.cn)("inline-flex items-center justify-center gap-1.5 rounded-sm border border-border px-2 py-1.5","font-mono text-[11px] text-foreground transition-colors hover:bg-secondary"),children:[(0,eT.jsx)(oE,{className:"size-3"}),"Open on GitHub"]})]})})}let gy=[{id:"vercel",name:"Vercel AI Gateway",blurb:"Zero-config routing to OpenAI, Anthropic, Google and more. Recommended default.",envVar:"AI_GATEWAY_API_KEY",keyPrefix:"vck_",needsKey:!0,keyUrl:"https://vercel.com/docs/ai-gateway",models:[{id:"anthropic/claude-opus-4.6",label:"Claude Opus 4.6",note:"Deepest reasoning · best for security"},{id:"anthropic/claude-sonnet-4.5",label:"Claude Sonnet 4.5",note:"Balanced quality / speed"},{id:"openai/gpt-5",label:"GPT-5",note:"Strong general analysis"},{id:"openai/gpt-5-mini",label:"GPT-5 Mini",note:"Fast triage pass"},{id:"google/gemini-3-flash",label:"Gemini 3 Flash",note:"Very fast, large context"}]},{id:"openrouter",name:"OpenRouter",blurb:"Single key, hundreds of models across providers — including free tiers.",envVar:"OPENROUTER_API_KEY",keyPrefix:"sk-or-",needsKey:!0,keyUrl:"https://openrouter.ai/keys",models:[{id:"meta-llama/llama-3.3-70b-instruct:free",label:"Llama 3.3 70B (free)",note:"Free · solid general text model"},{id:"deepseek/deepseek-chat-v3-0324:free",label:"DeepSeek V3 (free)",note:"Free · strong reasoning"},{id:"google/gemini-2.0-flash-exp:free",label:"Gemini 2.0 Flash (free)",note:"Free · fast, large context"},{id:"anthropic/claude-opus-4.6",label:"Claude Opus 4.6"},{id:"anthropic/claude-3.7-sonnet",label:"Claude 3.7 Sonnet"},{id:"openai/gpt-5",label:"GPT-5"},{id:"google/gemini-2.5-pro",label:"Gemini 2.5 Pro"},{id:"deepseek/deepseek-r1",label:"DeepSeek R1",note:"Open weights"},{id:"meta-llama/llama-3.3-70b-instruct",label:"Llama 3.3 70B"}]},{id:"anthropic",name:"Anthropic",blurb:"Claude models directly from Anthropic.",envVar:"ANTHROPIC_API_KEY",keyPrefix:"sk-ant-",needsKey:!0,keyUrl:"https://console.anthropic.com/settings/keys",models:[{id:"claude-opus-4-6",label:"Claude Opus 4.6",note:"Best for security review"},{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5"},{id:"claude-haiku-4",label:"Claude Haiku 4",note:"Fast triage"}]},{id:"openai",name:"OpenAI",blurb:"GPT models directly from OpenAI.",envVar:"OPENAI_API_KEY",keyPrefix:"sk-",needsKey:!0,keyUrl:"https://platform.openai.com/api-keys",models:[{id:"gpt-5",label:"GPT-5"},{id:"gpt-5-mini",label:"GPT-5 Mini",note:"Fast triage"},{id:"o4-mini",label:"o4-mini",note:"Reasoning, low cost"}]},{id:"xai",name:"xAI (Grok)",blurb:"Grok models from xAI. Requires an AI Gateway key with xAI enabled.",envVar:"XAI_API_KEY",keyPrefix:"xai-",needsKey:!0,keyUrl:"https://x.ai/api",models:[{id:"grok-4",label:"Grok 4"},{id:"grok-4-fast",label:"Grok 4 Fast",note:"Fast triage"}]},{id:"ollama",name:"Ollama (local)",blurb:"Run models fully offline on your machine. No code leaves your computer.",envVar:"OLLAMA_HOST",needsKey:!1,keyUrl:"https://ollama.com",models:[{id:"qwen2.5-coder:14b",label:"Qwen2.5 Coder 14B",note:"Best local code model"},{id:"llama3.1:8b",label:"Llama 3.1 8B",note:"Lightweight"},{id:"deepseek-r1:14b",label:"DeepSeek R1 14B",note:"Reasoning"}]}];function gb(e){return gy.find(t=>t.id===e)??gy[0]}let gk={provider:"openrouter",model:"meta-llama/llama-3.3-70b-instruct:free",keys:{},aiEnabled:!0,redactSecrets:!0,maxFiles:25,chatEnabled:!0,persistChats:!0,githubToken:"",defaultRepo:"",colorAccents:!1},gj="projectlens.settings.v1";function gw(e){"u">typeof document&&document.documentElement.classList.toggle("accents",e)}function gN(){try{let e=window.localStorage.getItem(gj);if(!e)return gk;let t=JSON.parse(e);return{...gk,...t,keys:{...gk.keys,...t.keys}}}catch{return gk}}function g_(e){window.localStorage.setItem(gj,JSON.stringify(e))}let gS={modified:"M",added:"A",deleted:"D",untracked:"??",renamed:"R"},g$={modified:"var(--sev-medium)",added:"var(--sev-ok)",deleted:"var(--sev-critical)",untracked:"var(--sev-medium)",renamed:"var(--sev-info)"};function gI(e){switch(e){case"passing":return{Icon:da,color:"var(--sev-ok)",label:"Passing"};case"failing":return{Icon:i5,color:"var(--sev-critical)",label:"Failing"};case"disabled":return{Icon:d9,color:"var(--sev-info)",label:"Disabled"};default:return{Icon:d9,color:"var(--sev-info)",label:"No runs"}}}function gE({value:e,label:t="Copy"}){let[n,r]=(0,eP.useState)(!1);return(0,eT.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),window.setTimeout(()=>r(!1),1400)})},className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(oC,{className:"size-3.5"}),n?"Copied":t]})}function gC({label:e,children:t}){return(0,eT.jsxs)("div",{className:"flex items-baseline gap-3 px-3 py-2",children:[(0,eT.jsx)("span",{className:"w-24 shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 text-sm text-foreground",children:t})]})}function gA({detail:e,remoteInfo:t,onClose:n}){let r=t?.provider==="GitHub"?t.url:null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&n(),children:(0,eT.jsxs)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-xl",children:[e?.kind==="commit"&&(0,eT.jsx)(gT,{commit:e.commit,ghBase:r}),e?.kind==="branch"&&(0,eT.jsx)(gP,{branch:e.branch,ghBase:r}),e?.kind==="tag"&&(0,eT.jsx)(gz,{tag:e.tag,ghBase:r})]})})}function gT({commit:e,ghBase:t}){let n=e.fullHash||e.hash,[r,...i]=e.message.split("\n"),a=e.body||i.join("\n").trim();return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(cE,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate text-sm",children:r})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Commit detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:e.hash}),(0,eT.jsx)(gE,{value:n,label:"Copy SHA"}),t&&(0,eT.jsxs)("a",{href:`${t}/commit/${n}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View on GitHub"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[a&&(0,eT.jsx)("p",{className:"whitespace-pre-wrap text-pretty text-sm leading-relaxed text-muted-foreground",children:a}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[(0,eT.jsxs)(gC,{label:"Author",children:[e.author,e.email&&(0,eT.jsxs)("span",{className:"ml-1.5 font-mono text-xs text-muted-foreground",children:["<",e.email,">"]})]}),(0,eT.jsxs)(gC,{label:"Date",children:[(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.relative}),e.date&&(0,eT.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:new Date(e.date).toLocaleString()})]}),(0,eT.jsx)(gC,{label:"Commit",children:(0,eT.jsx)("span",{className:"break-all font-mono text-xs",children:n})}),(null!=e.insertions||null!=e.deletions)&&(0,eT.jsx)(gC,{label:"Changes",children:(0,eT.jsxs)("span",{className:"font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"text-[color:var(--sev-ok)]",children:["+",e.insertions??0]})," ",(0,eT.jsxs)("span",{className:"text-[color:var(--sev-critical)]",children:["-",e.deletions??0]}),e.files?` \xb7 ${e.files.length} files`:""]})}),e.refs&&e.refs.length>0&&(0,eT.jsx)(gC,{label:"Refs",children:(0,eT.jsx)("span",{className:"flex flex-wrap gap-1",children:e.refs.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},e))})})]})}),e.files&&e.files.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(cL,{className:"size-3.5"})," Files changed (",e.files.length,")"]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:e.files.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2.5 border-t border-border px-3 py-2 first:border-t-0",children:[(0,eT.jsx)("span",{className:"w-5 shrink-0 text-center font-mono text-[10px]",style:{color:g$[e.status]},children:gS[e.status]}),(0,eT.jsx)(lR,{path:e.path,className:"text-xs"})]},e.path))})]})]})]})}function gP({branch:e,ghBase:t}){return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[e.remote?(0,eT.jsx)(cO,{className:"size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eK,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:e.name})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Branch detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.current&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/15 font-mono text-[10px] text-[color:var(--sev-ok)]",children:"current"}),e.merged&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(cZ,{className:"size-3"})," merged"]}),(0,eT.jsx)(gE,{value:e.name,label:"Copy name"}),t&&!e.remote&&(0,eT.jsxs)("a",{href:`${t}/tree/${e.name}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View on GitHub"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-lg tabular-nums text-foreground",children:[(0,eT.jsx)(cC,{className:"size-3.5 text-[color:var(--sev-ok)]"})," ",e.ahead??0]}),(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"ahead of default"})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-lg tabular-nums text-foreground",children:[(0,eT.jsx)(cA,{className:"size-3.5 text-[color:var(--sev-high)]"})," ",e.behind??0]}),(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"behind default"})]})]}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[(0,eT.jsx)(gC,{label:"Type",children:e.remote?"Remote-tracking":"Local"}),e.upstream&&(0,eT.jsx)(gC,{label:"Upstream",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.upstream})}),e.tip&&(0,eT.jsx)(gC,{label:"Tip",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.tip})}),e.subject&&(0,eT.jsx)(gC,{label:"Last commit",children:e.subject}),e.author&&(0,eT.jsx)(gC,{label:"Author",children:e.author}),e.lastCommitRelative&&(0,eT.jsx)(gC,{label:"Updated",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.lastCommitRelative})})]})})]})]})}function gz({tag:e,ghBase:t}){return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(cM,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:e.name})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Tag detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.annotated?"annotated":"lightweight"}),(0,eT.jsx)(gE,{value:e.name,label:"Copy tag"}),t&&(0,eT.jsxs)("a",{href:`${t}/releases/tag/${e.name}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View release"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[e.message&&(0,eT.jsx)("p",{className:"whitespace-pre-wrap text-pretty text-sm leading-relaxed text-muted-foreground",children:e.message}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[e.commit&&(0,eT.jsx)(gC,{label:"Commit",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.commit})}),e.tagger&&(0,eT.jsx)(gC,{label:"Tagger",children:e.tagger}),e.relative&&(0,eT.jsxs)(gC,{label:"Date",children:[(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.relative}),e.date&&(0,eT.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:new Date(e.date).toLocaleDateString()})]})]})})]})]})}function gO({issue:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o1(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o1(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"mt-1.5",children:(0,eT.jsx)(lR,{path:e.filePath,className:"text-[11px]"})})]}),(0,eT.jsx)(lM,{issue:o1(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function gM({step:e}){let t=e.diagnostics&&e.diagnostics.length>0;return(0,eT.jsx)("div",{className:"flex flex-col gap-1 border-t border-border px-3 py-2 first:border-t-0",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[t?(0,eT.jsx)(i5,{className:"mt-0.5 size-3.5 shrink-0 text-[color:var(--sev-high)]"}):(0,eT.jsx)(da,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/50"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"text-xs text-foreground",children:e.name}),e.uses&&(0,eT.jsx)("span",{className:"ml-2 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.uses}),e.run&&(0,eT.jsxs)("pre",{className:"mt-1 overflow-x-auto rounded-sm bg-background/60 px-2 py-1 font-mono text-[11px] text-foreground/80",children:["$ ",e.run]}),e.condition&&(0,eT.jsxs)("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground",children:["if: ",e.condition]}),t&&e.diagnostics.map((e,t)=>(0,eT.jsxs)("p",{className:"mt-1 flex items-start gap-1 text-[11px] leading-relaxed text-[color:var(--sev-high)]",children:[(0,eT.jsx)(cU,{className:"mt-0.5 size-3 shrink-0"})," ",e]},t))]})]})})}function gR({job:e}){let[t,n]=(0,eP.useState)("failing"===e.status),r=gI(e.status);return(0,eT.jsxs)("div",{className:"overflow-hidden rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(r.Icon,{className:"size-4 shrink-0",style:{color:r.color}}),(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.name}),e.runsOn&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.runsOn}),e.needs&&e.needs.length>0&&(0,eT.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["needs: ",e.needs.join(", ")]}),(0,eT.jsxs)("span",{className:"ml-auto flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[null!=e.durationMs&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(i4,{className:"size-3"})," ",(e.durationMs/1e3).toFixed(0),"s"]}),e.steps&&(0,eT.jsxs)("span",{children:[e.steps.length," steps"]}),(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})]})]}),t&&e.condition&&(0,eT.jsxs)("p",{className:"border-t border-border bg-secondary/20 px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:["if: ",e.condition]}),t&&e.steps&&e.steps.length>0&&(0,eT.jsx)("div",{className:"border-t border-border",children:e.steps.map((e,t)=>(0,eT.jsx)(gM,{step:e},`${e.name}-${t}`))})]})}function gD({wf:e}){let t=gI(e.status);return(0,eT.jsxs)(s8,{className:"gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-3 border-b border-border bg-secondary/30 px-4 py-3",children:[(0,eT.jsx)(cT,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:e.name}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[11px]",style:{color:t.color},children:[(0,eT.jsx)(t.Icon,{className:"size-3.5"}),t.label]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.provider})]}),(0,eT.jsx)(lR,{path:e.file,className:"text-[11px]"})]}),(0,eT.jsx)("div",{className:"flex shrink-0 flex-wrap justify-end gap-1",children:e.triggers.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},e))})]}),(e.concurrency||e.permissions&&e.permissions.length>0||e.env&&e.env.length>0)&&(0,eT.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-b border-border px-4 py-2 font-mono text-[10px] text-muted-foreground",children:[e.concurrency&&(0,eT.jsxs)("span",{children:["concurrency: ",e.concurrency]}),e.permissions&&e.permissions.length>0&&(0,eT.jsxs)("span",{children:["permissions: ",e.permissions.join(", ")]}),e.env&&e.env.length>0&&(0,eT.jsxs)("span",{children:["env: ",e.env.join(", ")]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-2 p-3",children:e.jobs.map(e=>(0,eT.jsx)(gR,{job:e},e.name))}),e.diagnosis&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border bg-secondary/20 px-4 py-3",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(cU,{className:"size-3.5"}),"Diagnose & run locally"]}),e.diagnosis.localCommand&&(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsxs)("pre",{className:"flex-1 overflow-x-auto rounded-sm border border-border bg-background/60 px-2.5 py-1.5 font-mono text-[11px] text-foreground",children:[(0,eT.jsx)(e2,{className:"mr-1.5 inline size-3 text-muted-foreground"}),e.diagnosis.localCommand]}),(0,eT.jsx)(gE,{value:e.diagnosis.localCommand})]}),(0,eT.jsx)("ul",{className:"flex flex-col gap-1",children:e.diagnosis.notes.map((e,t)=>(0,eT.jsxs)("li",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-muted-foreground",children:[(0,eT.jsx)(a4,{className:"mt-0.5 size-3 shrink-0"})," ",e]},t))})]}),e.issues.length>0&&(0,eT.jsx)("div",{className:"flex flex-col border-t border-border",children:e.issues.map(e=>(0,eT.jsx)(gO,{issue:e},e.id))})]})}function gL({branch:e,onOpen:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2.5 border-t border-border px-4 py-2.5 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[e.current?(0,eT.jsx)(iq,{className:"size-3.5 shrink-0 text-[color:var(--sev-ok)]"}):e.remote?(0,eT.jsx)(cO,{className:"size-3.5 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eK,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)("min-w-0 flex-1 truncate font-mono text-xs",e.current?"font-semibold text-foreground":"text-foreground"),children:e.name}),null!=e.ahead&&e.ahead>0||null!=e.behind&&e.behind>0?(0,eT.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[null!=e.ahead&&e.ahead>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center",children:[(0,eT.jsx)(cC,{className:"size-3"}),e.ahead]}),null!=e.behind&&e.behind>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center",children:[(0,eT.jsx)(cA,{className:"size-3"}),e.behind]})]}):null,e.current&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/15 font-mono text-[10px] text-[color:var(--sev-ok)]",children:"current"}),e.remote&&!e.current&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:"remote"}),e.lastCommitRelative&&(0,eT.jsx)("span",{className:"hidden shrink-0 font-mono text-[10px] text-muted-foreground sm:inline",children:e.lastCommitRelative}),(0,eT.jsx)(a4,{className:"size-4 shrink-0 text-muted-foreground"})]})}function gU({git:e}){let{state:t}=e,[n,r]=(0,eP.useState)(!1),[i,a]=(0,eP.useState)("repository"),[s,o]=(0,eP.useState)(null),l=[...e.issues].sort(oq),d=t.branches.filter(e=>!e.remote),c=t.branches.filter(e=>e.remote),u=[...d,...c],[m,p]=(0,eP.useState)(null);(0,eP.useEffect)(()=>{let e=gN().defaultRepo.trim().match(/^([^/\s]+)\/([^/\s]+)$/);e&&p({owner:e[1],repo:e[2]})},[]);let f=(0,eP.useMemo)(()=>m||(t.remoteInfo?.provider==="GitHub"?{owner:t.remoteInfo.owner,repo:t.remoteInfo.name}:null),[t.remoteInfo,m]),[h,g]=(0,eP.useState)(f);(0,eP.useEffect)(()=>{m&&g(m)},[m]);let x=t.remoteInfo?.provider==="GitHub"||!!h,v=[{key:"repository",label:"Repository",Icon:dB,show:!0},{key:"cicd",label:"CI / CD",Icon:cT,show:!0,count:e.workflows.length},{key:"releases",label:"Releases",Icon:cD,show:x}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:v.filter(e=>e.show).map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>a(e.key),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-3 py-1.5 font-mono text-xs transition-colors",i===e.key?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.Icon,{className:"size-3.5"}),e.label,null!=e.count&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1 font-mono text-[10px] tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"releases"===i&&x?(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)(gg,{source:h,detected:f,onChange:g}),h?(0,eT.jsx)(gl,{owner:h.owner,repo:h.repo}):(0,eT.jsx)(s8,{className:"p-6 text-center text-sm text-muted-foreground",children:"Enter a GitHub owner/repo above to load releases."})]}):"cicd"===i?(0,eT.jsx)(gZ,{git:e}):(0,eT.jsx)(gF,{git:e,state:t,issues:l,orderedBranches:u,localBranches:d,remoteBranches:c,showRemote:n,setShowRemote:r,source:h,detected:f,setSource:g,isGithub:x,onOpenDetail:o}),(0,eT.jsx)(gA,{detail:s,remoteInfo:t.remoteInfo,onClose:()=>o(null)})]})}function gZ({git:e}){if(0===e.workflows.length)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(cT,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No CI/CD workflows detected"}),(0,eT.jsxs)("p",{className:"max-w-sm text-pretty text-sm text-muted-foreground",children:["Add a workflow under ",(0,eT.jsx)("span",{className:"font-mono",children:".github/workflows"})," (or a GitLab/CircleCI config) to see jobs, steps, and diagnostics here."]})]})]});let t=e.workflows.filter(e=>"passing"===e.status).length,n=e.workflows.filter(e=>"failing"===e.status).length,r=e.workflows.reduce((e,t)=>e+t.jobs.length,0);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-4",children:[(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Workflows"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:e.workflows.length})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Passing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:"var(--sev-ok)"},children:t})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Failing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:n>0?"var(--sev-critical)":"var(--sev-ok)"},children:n})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Jobs"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:r})]})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cT,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Pipelines"}),(0,eT.jsx)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:"expand a job to inspect its steps"})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-4",children:e.workflows.map(e=>(0,eT.jsx)(gD,{wf:e},e.id))})]})}function gF({git:e,state:t,issues:n,orderedBranches:r,localBranches:i,remoteBranches:a,showRemote:s,setShowRemote:o,source:l,detected:d,setSource:c,isGithub:u,onOpenDetail:m}){let p=(0,eP.useMemo)(()=>t.tagDetails&&t.tagDetails.length>0?t.tagDetails:t.tags.map(e=>({name:e})),[t.tagDetails,t.tags]);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[t.remoteInfo&&(0,eT.jsx)(oS,{title:"Repository",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cz,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"truncate font-mono text-sm text-foreground",children:[t.remoteInfo.owner,"/",t.remoteInfo.name]})]}),(0,eT.jsxs)("a",{href:t.remoteInfo.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm bg-secondary px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary/70",children:[(0,eT.jsx)(oE,{className:"size-3"}),"View on ",t.remoteInfo.provider]})]})}),u&&(0,eT.jsxs)(eT.Fragment,{children:[!d&&(0,eT.jsx)(gg,{source:l,detected:d,onChange:c}),l&&(0,eT.jsx)(gv,{source:l})]}),(0,eT.jsx)(oS,{title:"Working tree",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:t.branch})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-3 font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[(0,eT.jsx)(cC,{className:"size-3.5"})," ",t.ahead]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[(0,eT.jsx)(cA,{className:"size-3.5"})," ",t.behind]}),(0,eT.jsxs)("span",{className:"text-muted-foreground",children:["vs ",t.defaultBranch]})]}),(0,eT.jsx)("button",{type:"button",onClick:()=>m({kind:"commit",commit:t.recentCommits[0]??{...t.lastCommit}}),className:"border-t border-border pt-3 text-left transition-colors hover:opacity-80",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[(0,eT.jsx)(cE,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("p",{className:"truncate text-xs text-foreground",children:t.lastCommit.message}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[t.lastCommit.hash," · ",t.lastCommit.author," · ",t.lastCommit.relative]})]})]})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cP,{className:"size-3.5"})," ",t.contributors," authors"]}),(0,eT.jsxs)("span",{children:[t.totalCommits.toLocaleString()," commits"]})]}),(t.firstCommitRelative||null!=t.trackedFiles)&&(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[t.firstCommitRelative&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(i4,{className:"size-3.5"})," since ",t.firstCommitRelative]}),null!=t.trackedFiles&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(s9,{className:"size-3.5"})," ",t.trackedFiles.toLocaleString()," files"]})]}),(t.stashes>0||t.tags.length>0)&&(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cR,{className:"size-3.5"})," ",t.stashes," ",1===t.stashes?"stash":"stashes"]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cM,{className:"size-3.5"})," ",t.tags.length," tags"]})]})]})}),t.topContributors&&t.topContributors.length>0&&(0,eT.jsx)(oS,{title:"Top contributors",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-2",children:t.topContributors.map(e=>{let n=t.topContributors[0].commits||1;return(0,eT.jsxs)("li",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.commits})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full bg-foreground/40",style:{width:`${e.commits/n*100}%`}})})]},e.name)})})}),(0,eT.jsx)(oS,{title:`Changes (${t.changes.length})`,children:0===t.changes.length?(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"Working tree clean."}):(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:t.changes.map(e=>(0,eT.jsxs)("li",{className:"flex items-center gap-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"w-5 shrink-0 text-center text-[10px]",style:{color:g$[e.status]},children:gS[e.status]}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.path})]},e.path))})}),t.ignored.count>0&&(0,eT.jsx)(oS,{title:`Ignored files (${t.ignored.count})`,children:(0,eT.jsxs)("ul",{className:"flex flex-col gap-1.5",children:[t.ignored.samples.map(e=>(0,eT.jsxs)("li",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(cy,{className:"size-3.5 shrink-0"}),(0,eT.jsx)("span",{className:"truncate",children:e})]},e)),t.ignored.count>t.ignored.samples.length&&(0,eT.jsxs)("li",{className:"font-mono text-[10px] text-muted-foreground",children:["+",t.ignored.count-t.ignored.samples.length," more"]})]})}),(0,eT.jsx)(oS,{title:"Remote",action:t.remote?(0,eT.jsxs)("button",{type:"button",onClick:()=>o(e=>!e),"aria-pressed":s,"aria-label":s?"Hide remote URL":"Reveal remote URL",className:"inline-flex items-center gap-1 rounded-sm px-1 py-0.5 font-mono text-[10px] uppercase text-muted-foreground transition-colors hover:text-foreground",children:[s?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"}),s?"Hide":"Reveal"]}):void 0,children:t.remote?s?(0,eT.jsx)("p",{className:"break-all font-mono text-xs text-foreground",children:t.remote}):(0,eT.jsx)("p",{className:"font-mono text-xs tracking-widest text-muted-foreground","aria-hidden":!0,children:"•".repeat(28)}):(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:"No remote configured"})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[r.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Branches"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[i.length," local · ",a.length," remote"]})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(gL,{branch:e,onOpen:()=>m({kind:"branch",branch:e})},`${e.remote?"r":"l"}-${e.name}`))})]}),t.recentCommits.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cE,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Recent commits"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:t.recentCommits.length})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:t.recentCommits.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>m({kind:"commit",commit:e}),className:"flex w-full items-start gap-3 border-t border-border px-4 py-2.5 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:"mt-0.5 shrink-0 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.hash}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("p",{className:"truncate text-xs text-foreground",children:e.message.split("\n")[0]}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[e.author," · ",e.relative,null!=e.insertions&&(0,eT.jsxs)("span",{className:"ml-2",children:[(0,eT.jsxs)("span",{className:"text-[color:var(--sev-ok)]",children:["+",e.insertions]})," ",(0,eT.jsxs)("span",{className:"text-[color:var(--sev-critical)]",children:["-",e.deletions??0]})]})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]},e.hash))})]}),p.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cM,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Tags"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:p.length})]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:p.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>m({kind:"tag",tag:e}),className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary/70",children:[(0,eT.jsx)(cM,{className:"size-3"}),e.name,e.relative&&(0,eT.jsxs)("span",{className:"text-muted-foreground",children:["· ",e.relative]})]},e.name))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Repository findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:n.length})]}),0===n.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No repository hygiene issues detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:n.map(e=>(0,eT.jsx)(gO,{issue:e},e.id))})]})]})]})}let gB=eL("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);function gV({label:e,value:t,sub:n}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card p-4",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:t}),(0,eT.jsx)("span",{className:"text-xs font-medium text-foreground",children:e}),n&&(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n})]})}function gq({c:e}){return(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:(0,eT.jsxs)("div",{className:"flex items-start gap-3 p-4",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-sm",e.present?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-[color:var(--sev-medium)]/15 text-[color:var(--sev-medium)]"),children:e.present?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(sz,{className:"size-3.5"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:e.name}),e.present?(0,eT.jsx)(lR,{path:e.file,className:"text-[11px]"}):(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground line-through",children:e.file}),null!=e.ruleCount&&(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-[10px]",children:[e.ruleCount," rules"]})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.summary}),e.highlights&&e.highlights.length>0&&(0,eT.jsx)("dl",{className:"mt-3 grid grid-cols-1 gap-px overflow-hidden rounded-sm border border-border bg-border sm:grid-cols-2",children:e.highlights.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 bg-card px-2.5 py-1.5",children:[(0,eT.jsx)("dt",{className:"font-mono text-[11px] text-muted-foreground",children:e.label}),(0,eT.jsx)("dd",{className:(0,ny.cn)("font-mono text-[11px] tabular-nums",!1===e.good?"text-[color:var(--sev-high)]":e.good?"text-[color:var(--sev-ok)]":"text-foreground"),children:e.value})]},e.label))})]})]})})}function gW({setup:e}){let{stats:t}=e,n=[{label:"Code",value:t.codeLoc,color:"var(--chart-1)"},{label:"Comments",value:t.commentLoc,color:"var(--chart-3)"},{label:"Blank",value:t.blankLoc,color:"var(--chart-5)"}],r=t.languages.map(e=>({key:e.language,label:e.language,count:e.loc,hint:`${e.files} files \xb7 ${Math.round(100*e.share)}%`})),i=t.largestFiles.map(e=>({key:e.path,label:e.path,count:e.loc}));return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Tooling detected",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.tooling.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-4 items-center justify-center rounded-[3px]",e.detected?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-secondary text-muted-foreground"),children:e.detected?(0,eT.jsx)(iq,{className:"size-3"}):(0,eT.jsx)(sz,{className:"size-3"})}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.detected?"text-foreground":"text-muted-foreground"),children:e.name})]}),e.version&&(0,eT.jsx)("span",{className:"font-mono text-[10px] tabular-nums text-muted-foreground",children:e.version})]},e.name))})}),(0,eT.jsxs)(oS,{title:"LOC composition",children:[(0,eT.jsx)(o$,{segments:n}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(100*t.commentRatio).toFixed(1),"% comments · ",(100*t.testRatio).toFixed(0),"% test ratio"]})]}),(0,eT.jsx)(oS,{title:"Languages",children:(0,eT.jsx)(oI,{rows:r})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(gB,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Workspace statistics"})]}),(0,eT.jsxs)(s8,{className:"grid grid-cols-2 gap-px overflow-hidden bg-border p-0 sm:grid-cols-3 lg:grid-cols-4",children:[(0,eT.jsx)(gV,{label:"Files",value:t.totalFiles}),(0,eT.jsx)(gV,{label:"Lines of code",value:t.totalLoc.toLocaleString(),sub:`${t.codeLoc.toLocaleString()} code`}),(0,eT.jsx)(gV,{label:"Components",value:t.components}),(0,eT.jsx)(gV,{label:"Routes",value:t.routes}),(0,eT.jsx)(gV,{label:"Test files",value:t.testFiles,sub:`${t.testLoc.toLocaleString()} LOC`}),(0,eT.jsx)(gV,{label:"Comments",value:`${(100*t.commentRatio).toFixed(1)}%`,sub:"of code"}),(0,eT.jsx)(gV,{label:"Test ratio",value:`${(100*t.testRatio).toFixed(0)}%`,sub:"tests : code"}),(0,eT.jsx)(gV,{label:"TODO / FIXME",value:t.todoCount,sub:"markers"})]})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s5,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Largest files"})]}),(0,eT.jsx)(s8,{className:"p-3",children:(0,eT.jsx)(oI,{rows:i})})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eJ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Configuration & rules"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.configs.filter(e=>e.present).length,"/",e.configs.length]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-3",children:e.configs.map(e=>(0,eT.jsx)(gq,{c:e},e.id))})]})]})]})}let gH=eL("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);function gG(e){switch(e){case"pass":return{Icon:iq,color:"var(--sev-ok)",label:"Pass"};case"warn":return{Icon:dw,color:"var(--sev-medium)",label:"Warn"};case"na":return{Icon:lq,color:"var(--muted-foreground)",label:"N/A"};default:return{Icon:sz,color:"var(--sev-critical)",label:"Fail"}}}let gK={excellent:"Excellent",good:"Good","needs-improvement":"Needs improvement",poor:"Poor"};function gJ(e){return e>=80?"var(--sev-ok)":e>=60?"var(--sev-medium)":e>=40?"var(--sev-high)":"var(--sev-critical)"}function gY({score:e,label:t,sub:n}){let r=gJ(e);return(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-2 p-6",children:[(0,eT.jsxs)("div",{className:"relative flex size-28 items-center justify-center",children:[(0,eT.jsxs)("svg",{viewBox:"0 0 100 100",className:"size-full -rotate-90",children:[(0,eT.jsx)("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:"var(--border)",strokeWidth:"8"}),(0,eT.jsx)("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${e/100*264} 264`})]}),(0,eT.jsx)("span",{className:"absolute font-mono text-3xl font-semibold tabular-nums text-foreground",children:e})]}),(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:t}),(0,eT.jsx)("span",{className:"text-center text-xs text-muted-foreground",children:n})]})}function gX({standard:e,active:t,onSelect:n}){let r=gJ(e.score),i=e.checks.filter(e=>"pass"===e.status).length,a=e.checks.filter(e=>"na"!==e.status).length;return(0,eT.jsxs)("button",{type:"button",onClick:n,className:(0,ny.cn)("flex flex-col gap-3 rounded-md border bg-card p-4 text-left transition-colors",t?"border-ring ring-1 ring-ring":"border-border hover:bg-secondary/40"),children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:e.label}),e.liveOnly&&(0,eT.jsx)("span",{className:"shrink-0 rounded-sm border border-border px-1 py-0.5 font-mono text-[9px] uppercase text-muted-foreground",children:"live"})]}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-2 text-pretty text-[11px] leading-snug text-muted-foreground",children:e.tagline})]}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-2xl font-semibold tabular-nums",style:{color:r},children:e.score})]}),(0,eT.jsx)(om,{value:e.score,className:"h-1.5"}),(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:gK[e.band]}),(0,eT.jsxs)("span",{children:[i,"/",a," pass · ",Math.round(100*e.weight),"% wt"]})]})]})}function gQ({check:e,onOpen:t}){let n=gG(e.status);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)(n.Icon,{className:"mt-0.5 size-4 shrink-0",style:{color:n.color}}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),e.agent&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-3"}),"agent"]}),(0,eT.jsx)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:"na"===e.status?"n/a":`+${e.weight}`})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.fix&&(0,eT.jsxs)("p",{className:"mt-1.5 inline-flex items-start gap-1.5 text-pretty text-xs leading-relaxed text-foreground",children:[(0,eT.jsx)(s4,{className:"mt-0.5 size-3 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"line-clamp-1",children:e.fix})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function g0({doc:e}){return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border px-3 py-2.5 first:border-t-0",children:[(0,eT.jsx)(eZ,{className:(0,ny.cn)("size-4 shrink-0",e.present?"text-foreground":"text-muted-foreground")}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[e.present?(0,eT.jsx)(lR,{path:e.path,className:"text-xs"}):(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground line-through",children:e.path}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-1 text-[11px] text-muted-foreground",children:e.note})]}),e.present?(0,eT.jsx)("span",{className:"shrink-0 font-mono text-xs tabular-nums",style:{color:gJ(e.score)},children:e.score}):(0,eT.jsx)("span",{className:"shrink-0 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:"missing"})]})}function g1({standard:e,onOpenCheck:t}){let n=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.checks){let e=n.group??"";t.has(e)||t.set(e,[]),t.get(e).push(n)}return[...t.entries()]},[e.checks]);return(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(eY,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.label}),(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums",style:{color:gJ(e.score)},children:e.score}),(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"ml-auto inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[e.source,(0,eT.jsx)(oE,{className:"size-3"})]})]}),n.map(([n,r])=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[n&&(0,eT.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wider text-muted-foreground",children:n}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(gQ,{check:e,onOpen:()=>t(e)},e.id))})]},n||e.id))]})}function g2({docs:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)(null),a=(0,eP.useMemo)(()=>e.standards.flatMap(e=>e.checks),[e.standards]),s=(0,eP.useMemo)(()=>a.filter(e=>e.agent),[a]),o=a.filter(e=>"pass"===e.status).length,l=a.filter(e=>"na"!==e.status).length,d=s.filter(e=>"pass"===e.status).length,c=s.filter(e=>"na"!==e.status).length,u="all"===t?e.standards:e.standards.filter(e=>e.id===t),m=[{id:"all",label:"All standards"},...e.standards.map(e=>({id:e.id,label:e.label}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(s8,{className:"flex flex-col items-center gap-1 py-0",children:(0,eT.jsx)(gY,{score:e.score,label:`Docs Benchmark \xb7 ${e.grade}`,sub:`${gK[e.band]} — ${o}/${l} checks passing`})}),(0,eT.jsx)(oS,{title:"AI / Agent readiness",action:(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",e.agentReady?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-[color:var(--sev-high)]/15 text-[color:var(--sev-high)]"),children:e.agentReady?"Ready":"Not ready"}),children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-4"})," Agent score"]}),(0,eT.jsxs)("span",{className:"font-mono tabular-nums text-foreground",children:[e.agentScore,"/100"]})]}),(0,eT.jsx)(om,{value:e.agentScore,className:"h-1.5"}),(0,eT.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:[d,"/",c," agent-readiness checks pass across all standards. Adding AGENTS.md and llms.txt has the highest impact."]}),!e.liveUrl&&(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"No live docs URL set. Surface-level checks (robots, sitemap, .md mirrors, MCP) are marked N/A and excluded from scoring."})]})}),(0,eT.jsx)(oS,{title:"Documents",children:(0,eT.jsx)("div",{className:"-mx-3 -mb-3",children:e.documents.map(e=>(0,eT.jsx)(g0,{doc:e},e.path))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Benchmark composition"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.standards.length," standards"]})]}),(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.standards.map(e=>(0,eT.jsx)(gX,{standard:e,active:t===e.id,onSelect:()=>n(t=>t===e.id?"all":e.id)},e.id))})]}),(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:m.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>n(e.id),className:(0,ny.cn)("rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.id?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label},e.id))}),u.map(e=>(0,eT.jsx)(g1,{standard:e,onOpenCheck:t=>i({check:t,standard:e})},e.id))]}),(0,eT.jsx)(g4,{detail:r,onClose:()=>i(null)})]})}function g4({detail:e,onClose:t}){let n=e?.check,r=e?.standard,i=n?gG(n.status):null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:n&&r&&i&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",style:{color:i.color,background:`color-mix(in oklch, ${i.color} 14%, transparent)`},children:[(0,eT.jsx)(i.Icon,{className:"size-3"}),i.label]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:r.label}),n.agent&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-3"}),"agent"]}),n.group&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:n.group})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-sm leading-relaxed",children:n.label}),(0,eT.jsx)(oF,{className:"sr-only",children:"Documentation check detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Status"}),(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums",style:{color:i.color},children:i.label})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Weight"}),(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums text-foreground",children:"na"===n.status?"n/a":`+${n.weight}`})]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(eY,{className:"size-3.5"}),"What this checks"]}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:n.detail})]}),n.fix&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(s4,{className:"size-3.5"}),"How to fix"]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-pretty text-sm leading-relaxed text-foreground",children:n.fix})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(gu,{className:"size-3.5"}),"Standard"]}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card p-3",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:r.label}),(0,eT.jsx)("p",{className:"mt-0.5 text-pretty text-xs leading-relaxed text-muted-foreground",children:r.tagline}),(0,eT.jsxs)("a",{href:r.href,target:"_blank",rel:"noreferrer",className:"mt-2 inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[r.source,(0,eT.jsx)(oE,{className:"size-3"})]})]})]})]})]})})})}let g5={critical:"critical",serious:"high",moderate:"medium",minor:"low"};function g6({violation:e}){let{viewIssue:t}=l$(),n=oV(g5[e.impact]);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o4(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o4(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e.rule}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:e.impact}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.principle})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.help}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"truncate",children:[e.filePath,":",e.line]}),(0,eT.jsxs)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:[e.nodes," node",1===e.nodes?"":"s"]}),e.wcag.filter(e=>/^\d/.test(e)).map(e=>(0,eT.jsxs)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:["WCAG ",e]},e))]})]}),(0,eT.jsx)(lM,{issue:o4(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function g3({accessibility:e}){let[t,n]=(0,eP.useState)("all"),r=(0,eP.useMemo)(()=>[...e.violations].sort((e,t)=>oV(g5[t.impact]).rank-oV(g5[e.impact]).rank),[e.violations]),i=(0,eP.useMemo)(()=>"all"===t?r:r.filter(e=>e.impact===t),[r,t]),a=[{label:"Critical",value:e.counts.critical,color:"var(--chart-1)"},{label:"Serious",value:e.counts.serious,color:"var(--chart-2)"},{label:"Moderate",value:e.counts.moderate,color:"var(--chart-3)"},{label:"Minor",value:e.counts.minor,color:"var(--chart-4)"}],s=e.byPrinciple.map(e=>({key:e.principle,label:e.principle,count:e.count})),o=[{key:"all",label:"All",count:e.violations.length},{key:"critical",label:"Critical",count:e.counts.critical},{key:"serious",label:"Serious",count:e.counts.serious},{key:"moderate",label:"Moderate",count:e.counts.moderate},{key:"minor",label:"Minor",count:e.counts.minor}],l=e.score>=90?"var(--sev-ok)":e.score>=70?"var(--sev-medium)":"var(--sev-high)";return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Accessibility score",children:[(0,eT.jsxs)("div",{className:"flex items-end justify-between",children:[(0,eT.jsx)("span",{className:"font-mono text-4xl font-semibold tabular-nums",style:{color:l},children:e.score}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"out of 100"})]}),(0,eT.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-[color:var(--sev-ok)]",children:e.passes}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"checks passed"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-foreground",children:e.incomplete}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"need review"})]})]})]}),(0,eT.jsx)(oS,{title:"By impact",children:(0,eT.jsx)(o$,{segments:a})}),(0,eT.jsx)(oS,{title:"By WCAG principle",children:(0,eT.jsx)(oI,{rows:s})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:o.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eQ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"WCAG violations"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:i.length}),(0,eT.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(cv,{className:"size-3"}),"axe-core"]})]}),0===i.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No violations in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:i.map(e=>(0,eT.jsx)(g6,{violation:e},e.id))})]})]})}let g9=eL("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),g8={good:"var(--sev-ok)","needs-improvement":"var(--sev-medium)",poor:"var(--sev-high)"},g7={good:"Good","needs-improvement":"Needs work",poor:"Poor"};function xe({vital:e}){let t=g8[e.rating],n=1.5*e.threshold.poor,r=Math.min(100,e.value/n*100),i=Math.min(100,e.threshold.good/n*100),a=Math.min(100,e.threshold.poor/n*100);return(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"font-mono text-xs font-semibold text-foreground",children:e.id}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase",style:{color:t},children:g7[e.rating]})]}),(0,eT.jsxs)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:t},children:[e.value,(0,eT.jsx)("span",{className:"ml-0.5 text-sm text-muted-foreground",children:e.unit})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e.label}),(0,eT.jsxs)("div",{className:"relative mt-1 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:[(0,eT.jsx)("span",{className:"absolute inset-y-0 left-0 bg-[color:var(--sev-ok)]/30",style:{width:`${i}%`},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"absolute inset-y-0 bg-[color:var(--sev-medium)]/30",style:{left:`${i}%`,width:`${a-i}%`},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"absolute top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-card",style:{left:`${r}%`,background:t},"aria-hidden":!0})]})]})}function xt({bundle:e}){let t=g8[e.rating];return(0,eT.jsxs)("li",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-foreground",children:e.route}),(0,eT.jsxs)("span",{className:"shrink-0 font-mono tabular-nums",style:{color:t},children:[e.firstLoadKb," KB"]})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${Math.min(100,e.firstLoadKb/320*100)}%`,background:t}})})]})}function xn({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o5(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o5(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")}),null!=e.estimatedSavingKb&&e.estimatedSavingKb>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(g9,{className:"size-2.5"}),"save ~",e.estimatedSavingKb," KB"]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.title}),(0,eT.jsxs)("span",{className:"mt-1 block truncate font-mono text-[10px] text-muted-foreground",children:[e.filePath,e.line?`:${e.line}`:""]})]}),(0,eT.jsx)(lM,{issue:o5(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function xr({performance:e}){let[t,n]=(0,eP.useState)(!1),r=(0,eP.useMemo)(()=>{let n=[...e.findings].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank);return t?n.filter(e=>(e.estimatedSavingKb??0)>0):n},[e.findings,t]),i=e.findings.reduce((e,t)=>e+(t.estimatedSavingKb??0),0),a=e.score>=90?"var(--sev-ok)":e.score>=50?"var(--sev-medium)":"var(--sev-high)";return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:[(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Perf score"}),(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:a},children:e.score}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"Lighthouse-style"})]}),e.vitals.map(e=>(0,eT.jsx)(xe,{vital:e},e.id))]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"First Load JS by route",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-3",children:e.bundles.map(e=>(0,eT.jsx)(xt,{bundle:e},e.route))})}),(0,eT.jsx)(oS,{title:"Budget",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.totalBundleKb}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"KB shared JS"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-[color:var(--sev-ok)]",children:i}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"KB recoverable"})]})]})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(e0,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Optimization opportunities"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:r.length}),(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:(0,ny.cn)("ml-auto inline-flex items-center gap-1.5 rounded-sm border border-border px-2.5 py-1 font-mono text-[10px] uppercase transition-colors",t?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(eq,{className:"size-3"}),"Has savings"]})]}),0===r.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No optimization opportunities in this view."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(xn,{finding:e},e.id))})]})]})]})}let xi=eL("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);function xa(e){return e>=80?"var(--sev-ok)":e>=50?"var(--sev-medium)":e>0?"var(--sev-high)":"var(--sev-critical)"}function xs({label:e,value:t}){let n=xa(t);return(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:"font-mono tabular-nums",style:{color:n},children:[t,"%"]})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${t}%`,background:n}})})]})}function xo({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o6(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o6(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.title}),(0,eT.jsxs)("span",{className:"mt-1 block truncate font-mono text-[10px] text-muted-foreground",children:[e.filePath,e.line?`:${e.line}`:""]})]}),(0,eT.jsx)(lM,{issue:o6(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function xl({suite:e,expanded:t,onToggle:n}){let r="failed"===e.status,i=e.tests??[];return(0,eT.jsxs)("div",{className:"border-t border-border first:border-t-0",children:[(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},className:"flex w-full cursor-pointer items-center justify-between gap-3 p-4 transition-colors hover:bg-secondary/40",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,eT.jsx)("div",{className:"inline-flex size-4 shrink-0 items-center justify-center",children:(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})}),r?(0,eT.jsx)(i5,{className:"size-4 shrink-0 text-[color:var(--sev-critical)]"}):(0,eT.jsx)(da,{className:"size-4 shrink-0 text-[color:var(--sev-ok)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block truncate font-mono text-sm text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:e.filePath})]})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] tabular-nums",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(da,{className:"size-3"}),e.passed]}),e.failed>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-[color:var(--sev-critical)]",children:[(0,eT.jsx)(i5,{className:"size-3"}),e.failed]}),e.skipped>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(xi,{className:"size-3"}),e.skipped]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(i4,{className:"size-3"}),(e.durationMs/1e3).toFixed(1),"s"]})]})]}),t&&i.length>0&&(0,eT.jsx)("div",{className:"border-t border-border/50 bg-secondary/20",children:(0,eT.jsx)("div",{className:"flex flex-col divide-y divide-border/50",children:i.map(e=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2 p-3 font-mono text-xs",children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:["passed"===e.status?(0,eT.jsx)(da,{className:"size-3.5 shrink-0 text-[color:var(--sev-ok)]"}):"failed"===e.status?(0,eT.jsx)(i5,{className:"size-3.5 shrink-0 text-[color:var(--sev-critical)]"}):(0,eT.jsx)(xi,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)("truncate font-medium","failed"===e.status?"text-foreground":"text-muted-foreground"),children:e.name})]}),null!=e.durationMs&&(0,eT.jsxs)("span",{className:"shrink-0 text-muted-foreground/70",children:[(e.durationMs/1e3).toFixed(2),"s"]})]}),e.error&&(0,eT.jsx)("div",{className:"ml-5 rounded-sm border border-[color:var(--sev-critical)]/20 bg-[color:var(--sev-critical)]/5 px-2 py-1.5 text-[10px]",children:(0,eT.jsx)("div",{className:"font-semibold text-[color:var(--sev-critical)]",children:e.error})}),e.assertions&&e.assertions.length>0&&(0,eT.jsx)("div",{className:"ml-5 flex flex-col gap-1",children:e.assertions.map((e,t)=>(0,eT.jsxs)("div",{className:"flex items-start gap-2 text-muted-foreground/80",children:[(0,eT.jsx)("span",{className:"mt-0.5 inline-flex size-1.5 shrink-0 rounded-full bg-current"}),(0,eT.jsx)("span",{className:"truncate",children:e})]},t))})]},e.name))})})]})}function xd({file:e}){let t=xa(e.lines);return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border p-4 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block truncate font-mono text-sm text-foreground",children:e.filePath}),(0,eT.jsx)("div",{className:"mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${e.lines}%`,background:t}})})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 flex-col items-end",children:[(0,eT.jsxs)("span",{className:"font-mono text-sm tabular-nums",style:{color:t},children:[e.lines,"%"]}),(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:"lines"})]})]})}function xc({tests:e}){let[t,n]=(0,eP.useState)("findings"),[r,i]=(0,eP.useState)(new Set),a=(0,eP.useMemo)(()=>[...e.findings].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank),[e.findings]),s=(0,eP.useMemo)(()=>[...e.suites].sort((e,t)=>t.failed-e.failed||t.durationMs-e.durationMs),[e.suites]),o=(0,eP.useMemo)(()=>[...e.files].sort((e,t)=>e.lines-t.lines),[e.files]),l=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0,d=[{key:"findings",label:"Findings",count:a.length},{key:"suites",label:"Suites",count:s.length},{key:"coverage",label:"Coverage",count:o.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Pass rate"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:e.counts.failed>0?"var(--sev-high)":"var(--sev-ok)"},children:[l,"%"]}),(0,eT.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.counts.passed,"/",e.counts.total," passing · ",e.counts.skipped," skipped"]})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Failing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:e.counts.failed>0?"var(--sev-critical)":"var(--sev-ok)"},children:e.counts.failed}),(0,eT.jsxs)("span",{className:"text-xs text-muted-foreground",children:["across ",e.counts.suites," suites"]})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Line coverage"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:xa(e.coverage.lines)},children:[e.coverage.lines,"%"]}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:e.framework})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Duration"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:[(e.counts.durationMs/1e3).toFixed(1),"s"]}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"full suite run"})]})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsx)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:(0,eT.jsx)(oS,{title:"Coverage breakdown",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsx)(xs,{label:"Lines",value:e.coverage.lines}),(0,eT.jsx)(xs,{label:"Functions",value:e.coverage.functions}),(0,eT.jsx)(xs,{label:"Branches",value:e.coverage.branches}),(0,eT.jsx)(xs,{label:"Statements",value:e.coverage.statements})]})})}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:d.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e1,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"findings"===t?"Test findings":"suites"===t?"Test suites":"Lowest coverage files"})]}),"findings"===t&&(0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No test findings — suite is healthy."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>(0,eT.jsx)(xo,{finding:e},e.id))})),"suites"===t&&(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:s.map(e=>(0,eT.jsx)(xl,{suite:e,expanded:r.has(e.id),onToggle:()=>{var t;let n;return t=e.id,void((n=new Set(r)).has(t)?n.delete(t):n.add(t),i(n))}},e.id))}),"coverage"===t&&(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:o.map(e=>(0,eT.jsx)(xd,{file:e},e.filePath))})]})]})]})}let xu=eL("sun-moon",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);var xm=/[\\\/_+.#"@\[\(\{&]/,xp=/[\\\/_+.#"@\[\(\{&]/g,xf=/[\s-]/,xh=/[\s-]/g;function xg(e){return e.toLowerCase().replace(xh," ")}function xx(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function xv(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function xy(...e){return t=>{let n=!1,r=e.map(e=>{let r=xv(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():xv(e[t],null)}}}}function xb(...e){return eP.useCallback(xy(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var xk=globalThis?.document?eP.useLayoutEffect:()=>{},xj=eP[" useId ".trim().toString()]||(()=>void 0),xw=0;function xN(e){let[t,n]=eP.useState(xj());return xk(()=>{e||n(e=>e??String(xw++))},[e]),e||(t?`radix-${t}`:"")}eP[" useEffectEvent ".trim().toString()],eP[" useInsertionEffect ".trim().toString()];var x_=eP[" useInsertionEffect ".trim().toString()]||xk;function xS(e){let t=eP.forwardRef((t,n)=>{var r;let i,a,{children:s,...o}=t,l=null,d=!1,c=[];xC(s)&&"function"==typeof xP&&(s=xP(s._payload)),eP.Children.forEach(s,e=>{var t;if(t=e,eP.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===x$){d=!0;let t="child"in e.props?e.props.child:e.props.children;xC(t)&&"function"==typeof xP&&(t=xP(t._payload)),l=xI(e,t),c.push(l?.props?.children)}else c.push(e)}),l?l=eP.cloneElement(l,void 0,c):!d&&1===eP.Children.count(s)&&eP.isValidElement(s)&&(l=s);let u=l?(r=l,(a=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(a=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,m=xb(n,u);if(!l){if(s||0===s)throw Error(d?xT(e):xA(e));return s}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}(o,l.props??{});return l.type!==eP.Fragment&&(p.ref=n?m:u),eP.cloneElement(l,p)});return t.displayName=`${e}.Slot`,t}Symbol("RADIX:SYNC_STATE");var x$=Symbol.for("radix.slottable"),xI=(e,t)=>{if("child"in e.props){let t=e.props.child;return eP.isValidElement(t)?eP.cloneElement(t,void 0,e.props.children(t.props.children)):null}return eP.isValidElement(t)?t:null},xE=Symbol.for("react.lazy");function xC(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===xE&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var xA=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,xT=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,xP=eP[" use ".trim().toString()],xz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=xS(`Primitive.${t}`),r=eP.forwardRef((e,r)=>{let{asChild:i,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,eT.jsx)(i?n:t,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xO(e){let t=eP.useRef(e);return eP.useEffect(()=>{t.current=e}),eP.useMemo(()=>(...e)=>t.current?.(...e),[])}var xM="dismissableLayer.update",xR=eP.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),xD=eP.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:o,onDismiss:l,...d}=e,c=eP.useContext(xR),[u,m]=eP.useState(null),p=u?.ownerDocument??globalThis?.document,[,f]=eP.useState({}),h=xb(t,e=>m(e)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=u?g.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,k=y>=v,j=eP.useRef(!1),w=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,s=xO(e),o=eP.useRef(!1),l=eP.useRef(!1),d=eP.useRef(new Map),c=eP.useRef(()=>{});return eP.useEffect(()=>{function e(){l.current=!1,i.current=!1,d.current.clear()}function t(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{l.current&&c.current()},0)}function u(e){l.current&&d.current.set(e.type,!1)}let m=t=>{if(t.target&&!o.current){let a=function(){n.removeEventListener("click",c.current);let t=Array.from(d.current.values()).some(Boolean);e(),t||xU("dismissableLayer.pointerDownOutside",s,o,{discrete:!0})},o={originalEvent:t};l.current=!0,i.current=r&&0===t.button,d.current.clear(),r&&0===t.button?(n.removeEventListener("click",c.current),c.current=a,n.addEventListener("click",c.current,{once:!0})):a()}else n.removeEventListener("click",c.current),e();o.current=!1},p=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of p)n.addEventListener(e,t,!0),n.addEventListener(e,u);let f=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{for(let e of(window.clearTimeout(f),n.removeEventListener("pointerdown",m),n.removeEventListener("click",c.current),p))n.removeEventListener(e,t,!0),n.removeEventListener(e,u)}},[n,s,r,i,a]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...c.branches].some(e=>e.contains(t));k&&!n&&(a?.(e),o?.(e),e.defaultPrevented||l?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:j,dismissableSurfaces:c.dismissableSurfaces}),N=function(e,t=globalThis?.document){let n=xO(e),r=eP.useRef(!1);return eP.useEffect(()=>{let e=e=>{e.target&&!r.current&&xU("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(r&&j.current)return;let t=e.target;![...c.branches].some(e=>e.contains(t))&&(s?.(e),o?.(e),e.defaultPrevented||l?.())},p);return!function(e,t=globalThis?.document){let n=xO(e);eP.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===c.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),eP.useEffect(()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(I=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),xL(),()=>{n&&(c.layersWithOutsidePointerEventsDisabled.delete(u),0===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=I))}},[u,p,n,c]),eP.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),xL())},[u,c]),eP.useEffect(()=>{let e=()=>f({});return document.addEventListener(xM,e),()=>document.removeEventListener(xM,e)},[]),(0,eT.jsx)(xz.div,{...d,ref:h,style:{pointerEvents:b?k?"auto":"none":void 0,...e.style},onFocusCapture:xx(e.onFocusCapture,N.onFocusCapture),onBlurCapture:xx(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:xx(e.onPointerDownCapture,w.onPointerDownCapture)})});function xL(){let e=new CustomEvent(xM);document.dispatchEvent(e)}function xU(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&aG.flushSync(()=>i.dispatchEvent(a));else i.dispatchEvent(a)}xD.displayName="DismissableLayer",eP.forwardRef((e,t)=>{let n=eP.useContext(xR),r=eP.useRef(null),i=xb(t,r);return eP.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,eT.jsx)(xz.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var xZ="focusScope.autoFocusOnMount",xF="focusScope.autoFocusOnUnmount",xB={bubbles:!1,cancelable:!0},xV=eP.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[o,l]=eP.useState(null),d=xO(i),c=xO(a),u=eP.useRef(null),m=xb(t,e=>l(e)),p=eP.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;eP.useEffect(()=>{if(r){let e=function(e){if(p.paused||!o)return;let t=e.target;o.contains(t)?u.current=t:xH(u.current,{select:!0})},t=function(e){if(p.paused||!o)return;let t=e.relatedTarget;null!==t&&(o.contains(t)||xH(u.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xH(o)});return o&&n.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,o,p.paused]),eP.useEffect(()=>{if(o){xG.add(p);let e=document.activeElement;if(!o.contains(e)){let t=new CustomEvent(xZ,xB);o.addEventListener(xZ,d),o.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xH(r,{select:t}),document.activeElement!==n)return}(xq(o).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&xH(o))}return()=>{o.removeEventListener(xZ,d),setTimeout(()=>{let t=new CustomEvent(xF,xB);o.addEventListener(xF,c),o.dispatchEvent(t),t.defaultPrevented||xH(e??document.body,{select:!0}),o.removeEventListener(xF,c),xG.remove(p)},0)}}},[o,d,c,p]);let f=eP.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){var a;let t,r=e.currentTarget,[s,o]=[xW(t=xq(a=r),a),xW(t.reverse(),a)];s&&o?e.shiftKey||i!==o?e.shiftKey&&i===s&&(e.preventDefault(),n&&xH(o,{select:!0})):(e.preventDefault(),n&&xH(s,{select:!0})):i===r&&e.preventDefault()}},[n,r,p.paused]);return(0,eT.jsx)(xz.div,{tabIndex:-1,...s,ref:m,onKeyDown:f})});function xq(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xW(e,t){for(let n of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function xH(e,{select:t=!1}={}){if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}xV.displayName="FocusScope";var xG=(r=[],{add(e){let t=r[0];e!==t&&t?.pause(),(r=xK(r,e)).unshift(e)},remove(e){r=xK(r,e),r[0]?.resume()}});function xK(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var xJ=eP.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=eP.useState(!1);xk(()=>a(!0),[]);let s=n||i&&globalThis?.document?.body;return s?aG.createPortal((0,eT.jsx)(xz.div,{...r,ref:t}),s):null});xJ.displayName="Portal";var xY=e=>{var t;let n,r,{present:i,children:a}=e,s=function(e){var t,n;let[r,i]=eP.useState(),a=eP.useRef(null),s=eP.useRef(e),o=eP.useRef("none"),[l,d]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},eP.useReducer((e,t)=>n[e][t]??e,t));return eP.useEffect(()=>{let e=xQ(a.current);o.current="mounted"===l?e:"none"},[l]),xk(()=>{let t=a.current,n=s.current;if(n!==e){let r=o.current,i=xQ(t);e?d("MOUNT"):"none"===i||t?.display==="none"?d("UNMOUNT"):n&&r!==i?d("ANIMATION_OUT"):d("UNMOUNT"),s.current=e}},[e,d]),xk(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=xQ(a.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(d("ANIMATION_END"),!s.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(o.current=xQ(a.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}d("ANIMATION_END")},[r,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:eP.useCallback(e=>{a.current=e?getComputedStyle(e):null,i(e)},[])}}(i),o="function"==typeof a?a({present:s.isPresent}):eP.Children.only(a),l=function(...e){let t=eP.useRef(e);return t.current=e,eP.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=xX(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():xX(n[e],null)}}},[])}(s.ref,(t=o,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof a||s.isPresent?eP.cloneElement(o,{ref:l}):null};function xX(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function xQ(e){return e?.animationName||"none"}xY.displayName="Presence";var x0=0,x1=null;function x2(){let 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 x4=function(){return(x4=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function x5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var x6=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),x3="width-before-scroll-bar";function x9(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var x8="u">typeof window?eP.useLayoutEffect:eP.useEffect,x7=new WeakMap,ve=(void 0===h&&(h={}),(void 0===g&&(g=function(e){return e}),x=[],v=!1,y={read:function(){if(v)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return x.length?x[x.length-1]:null},useMedium:function(e){var t=g(e,v);return x.push(t),function(){x=x.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(v=!0;x.length;){var t=x;x=[],t.forEach(e)}x={push:function(t){return e(t)},filter:function(){return x}}},assignMedium:function(e){v=!0;var t=[];if(x.length){var n=x;x=[],n.forEach(e),t=x}var r=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(r)};i(),x={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),x}}}}).options=x4({async:!0,ssr:!1},h),y),vt=function(){},vn=eP.forwardRef(function(e,t){var n,r,i,a,s=eP.useRef(null),o=eP.useState({onScrollCapture:vt,onWheelCapture:vt,onTouchMoveCapture:vt}),l=o[0],d=o[1],c=e.forwardProps,u=e.children,m=e.className,p=e.removeScrollBar,f=e.enabled,h=e.shards,g=e.sideCar,x=e.noRelative,v=e.noIsolation,y=e.inert,b=e.allowPinchZoom,k=e.as,j=e.gapMode,w=x5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=(n=[s,t],r=function(e){return n.forEach(function(t){return x9(t,e)})},(i=(0,eP.useState)(function(){return{value:null,callback:r,facade:{get current(){return i.value},set current(value){var e=i.value;e!==value&&(i.value=value,i.callback(value,e))}}}})[0]).callback=r,a=i.facade,x8(function(){var e=x7.get(a);if(e){var t=new Set(e),r=new Set(n),i=a.current;t.forEach(function(e){r.has(e)||x9(e,null)}),r.forEach(function(e){t.has(e)||x9(e,i)})}x7.set(a,n)},[n]),a),_=x4(x4({},w),l);return eP.createElement(eP.Fragment,null,f&&eP.createElement(g,{sideCar:ve,removeScrollBar:p,shards:h,noRelative:x,noIsolation:v,inert:y,setCallbacks:d,allowPinchZoom:!!b,lockRef:s,gapMode:j}),c?eP.cloneElement(eP.Children.only(u),x4(x4({},_),{ref:N})):eP.createElement(void 0===k?"div":k,x4({},_,{className:m,ref:N}),u))});vn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vn.classNames={fullWidth:x3,zeroRight:x6};var vr=function(e){var t=e.sideCar,n=x5(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return eP.createElement(r,x4({},n))};vr.isSideCarExport=!0;var vi=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=E||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,i;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},va=function(){var e=vi();return function(t,n){eP.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vs=function(){var e=va();return function(t){return e(t.styles,t.dynamic),null}},vo={left:0,top:0,right:0,gap:0},vl=function(e){return parseInt(e||"",10)||0},vd=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[vl(n),vl(r),vl(i)]},vc=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return vo;var t=vd(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])}},vu=vs(),vm="data-scroll-locked",vp=function(e,t,n,r){var i=e.left,a=e.top,s=e.right,o=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(o,"px ").concat(r,";\n }\n body[").concat(vm,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(x6," {\n right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(x3," {\n margin-right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(x6," .").concat(x6," {\n right: 0 ").concat(r,";\n }\n \n .").concat(x3," .").concat(x3," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(vm,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},vf=function(){var e=parseInt(document.body.getAttribute(vm)||"0",10);return isFinite(e)?e:0},vh=function(){eP.useEffect(function(){return document.body.setAttribute(vm,(vf()+1).toString()),function(){var e=vf()-1;e<=0?document.body.removeAttribute(vm):document.body.setAttribute(vm,e.toString())}},[])},vg=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;vh();var a=eP.useMemo(function(){return vc(i)},[i]);return eP.createElement(vu,{styles:vp(a,!t,i,n?"":"!important")})},vx=!1;if("u">typeof window)try{var vv=Object.defineProperty({},"passive",{get:function(){return vx=!0,!0}});window.addEventListener("test",vv,vv),window.removeEventListener("test",vv,vv)}catch(e){vx=!1}var vy=!!vx&&{passive:!1},vb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},vk=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),vj(e,r)){var i=vw(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},vj=function(e,t){return"v"===e?vb(t,"overflowY"):vb(t,"overflowX")},vw=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},vN=function(e,t,n,r,i){var a,s=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),o=s*r,l=n.target,d=t.contains(l),c=!1,u=o>0,m=0,p=0;do{if(!l)break;var f=vw(e,l),h=f[0],g=f[1]-f[2]-s*h;(h||g)&&vj(e,l)&&(m+=g,p+=h);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!d&&l!==document.body||d&&(t.contains(l)||t===l))return u&&(i&&1>Math.abs(m)||!i&&o>m)?c=!0:!u&&(i&&1>Math.abs(p)||!i&&-o>p)&&(c=!0),c},v_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vS=function(e){return[e.deltaX,e.deltaY]},v$=function(e){return e&&"current"in e?e.current:e},vI=0,vE=[];let vC=(b=function(e){var t=eP.useRef([]),n=eP.useRef([0,0]),r=eP.useRef(),i=eP.useState(vI++)[0],a=eP.useState(vs)[0],s=eP.useRef(e);eP.useEffect(function(){s.current=e},[e]),eP.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(v$),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=eP.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var i,a=v_(e),o=n.current,l="deltaX"in e?e.deltaX:o[0]-a[0],d="deltaY"in e?e.deltaY:o[1]-a[1],c=e.target,u=Math.abs(l)>Math.abs(d)?"h":"v";if("touches"in e&&"h"===u&&"range"===c.type)return!1;var m=window.getSelection(),p=m&&m.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var f=vk(u,c);if(!f)return!0;if(f?i=u:(i="v"===u?"h":"v",f=vk(u,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||d)&&(r.current=i),!i)return!0;var h=r.current||i;return vN(h,t,e,"h"===h?l:d,!0)},[]),l=eP.useCallback(function(e){if(vE.length&&vE[vE.length-1]===a){var n="deltaY"in e?vS(e):v_(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var i=(s.current.shards||[]).map(v$).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?o(e,i[0]):!s.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),d=eP.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),c=eP.useCallback(function(e){n.current=v_(e),r.current=void 0},[]),u=eP.useCallback(function(t){d(t.type,vS(t),t.target,o(t,e.lockRef.current))},[]),m=eP.useCallback(function(t){d(t.type,v_(t),t.target,o(t,e.lockRef.current))},[]);eP.useEffect(function(){return vE.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,vy),document.addEventListener("touchmove",l,vy),document.addEventListener("touchstart",c,vy),function(){vE=vE.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,vy),document.removeEventListener("touchmove",l,vy),document.removeEventListener("touchstart",c,vy)}},[]);var p=e.removeScrollBar,f=e.inert;return eP.createElement(eP.Fragment,null,f?eP.createElement(a,{styles:"\n .block-interactivity-".concat(i," {pointer-events: none;}\n .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,p?eP.createElement(vg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ve.useMedium(b),vr);var vA=eP.forwardRef(function(e,t){return eP.createElement(vn,x4({},e,{ref:t,sideCar:vC}))});vA.classNames=vn.classNames;var vT=new WeakMap,vP=new WeakMap,vz={},vO=0,vM=function(e){return e&&(e.host||vM(e.parentNode))},vR=function(e,t,n,r){var i=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=vM(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});vz[n]||(vz[n]=new WeakMap);var a=vz[n],s=[],o=new Set,l=new Set(i),d=function(e){!e||o.has(e)||(o.add(e),d(e.parentNode))};i.forEach(d);var c=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(o.has(e))c(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,l=(vT.get(e)||0)+1,d=(a.get(e)||0)+1;vT.set(e,l),a.set(e,d),s.push(e),1===l&&i&&vP.set(e,!0),1===d&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),o.clear(),vO++,function(){s.forEach(function(e){var t=vT.get(e)-1,i=a.get(e)-1;vT.set(e,t),a.set(e,i),t||(vP.has(e)||e.removeAttribute(r),vP.delete(e)),i||e.removeAttribute(n)}),--vO||(vT=new WeakMap,vT=new WeakMap,vP=new WeakMap,vz={})}},vD=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),vR(r,i,n,"aria-hidden")):function(){return null}},vL="Dialog",[vU,vZ]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>eP.createContext(e));return function(n){let r=n?.[e]||t;return eP.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=eP.createContext(r);i.displayName=t+"Context";let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,o=n?.[e]?.[a]||i,l=eP.useMemo(()=>s,Object.values(s));return(0,eT.jsx)(o.Provider,{value:l,children:r})};return s.displayName=t+"Provider",[s,function(n,s){let o=s?.[e]?.[a]||i,l=eP.useContext(o);if(l)return l;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return eP.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(vL),[vF,vB]=vU(vL),vV=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,o=eP.useRef(null),l=eP.useRef(null),[d,c]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=function({defaultProp:e,onChange:t}){let[n,r]=eP.useState(e),i=eP.useRef(n),a=eP.useRef(t);return x_(()=>{a.current=t},[t]),eP.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}({defaultProp:t,onChange:n}),o=void 0!==e,l=o?e:i;{let t=eP.useRef(void 0!==e);eP.useEffect(()=>{let e=t.current;if(e!==o){let t=o?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. 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.`)}t.current=o},[o,r])}return[l,eP.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&s.current?.(n)}else a(t)},[o,e,a,s])]}({prop:r,defaultProp:i??!1,onChange:a,caller:vL});return(0,eT.jsx)(vF,{scope:t,triggerRef:o,contentRef:l,contentId:xN(),titleId:xN(),descriptionId:xN(),open:d,onOpenChange:c,onOpenToggle:eP.useCallback(()=>c(e=>!e),[c]),modal:s,children:n})};vV.displayName=vL;var vq="DialogTrigger";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(vq,n),a=xb(t,i.triggerRef);return(0,eT.jsx)(xz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":v8(i.open),...r,ref:a,onClick:xx(e.onClick,i.onOpenToggle)})}).displayName=vq;var vW="DialogPortal",[vH,vG]=vU(vW,{forceMount:void 0}),vK=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=vB(vW,t);return(0,eT.jsx)(vH,{scope:t,forceMount:n,children:eP.Children.map(r,e=>(0,eT.jsx)(xY,{present:n||a.open,children:(0,eT.jsx)(xJ,{asChild:!0,container:i,children:e})}))})};vK.displayName=vW;var vJ="DialogOverlay",vY=eP.forwardRef((e,t)=>{let n=vG(vJ,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=vB(vJ,e.__scopeDialog);return a.modal?(0,eT.jsx)(xY,{present:r||a.open,children:(0,eT.jsx)(vQ,{...i,ref:t})}):null});vY.displayName=vJ;var vX=xS("DialogOverlay.RemoveScroll"),vQ=eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(vJ,n),a=xb(t,function(){let e=eP.useContext(xR),[t,n]=eP.useState(null);return eP.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}());return(0,eT.jsx)(vA,{as:vX,allowPinchZoom:!0,shards:[i.contentRef],children:(0,eT.jsx)(xz.div,{"data-state":v8(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),v0="DialogContent",v1=eP.forwardRef((e,t)=>{let n=vG(v0,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=vB(v0,e.__scopeDialog);return(0,eT.jsx)(xY,{present:r||a.open,children:a.modal?(0,eT.jsx)(v2,{...i,ref:t}):(0,eT.jsx)(v4,{...i,ref:t})})});v1.displayName=v0;var v2=eP.forwardRef((e,t)=>{let n=vB(v0,e.__scopeDialog),r=eP.useRef(null),i=xb(t,n.contentRef,r);return eP.useEffect(()=>{let e=r.current;if(e)return vD(e)},[]),(0,eT.jsx)(v5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:xx(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:xx(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:xx(e.onFocusOutside,e=>e.preventDefault())})}),v4=eP.forwardRef((e,t)=>{let n=vB(v0,e.__scopeDialog),r=eP.useRef(!1),i=eP.useRef(!1);return(0,eT.jsx)(v5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),v5=eP.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,o=vB(v0,n);return eP.useEffect(()=>{x1||(x1={start:x2(),end:x2()});let{start:e,end:t}=x1;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),x0++,()=>{1===x0&&(x1?.start.remove(),x1?.end.remove(),x1=null),x0=Math.max(0,x0-1)}},[]),(0,eT.jsx)(eT.Fragment,{children:(0,eT.jsx)(xV,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,eT.jsx)(xD,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":v8(o.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>o.onOpenChange(!1)})})})}),v6="DialogTitle";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v6,n);return(0,eT.jsx)(xz.h2,{id:i.titleId,...r,ref:t})}).displayName=v6;var v3="DialogDescription";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v3,n);return(0,eT.jsx)(xz.p,{id:i.descriptionId,...r,ref:t})}).displayName=v3;var v9="DialogClose";function v8(e){return e?"open":"closed"}eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v9,n);return(0,eT.jsx)(xz.button,{type:"button",...r,ref:t,onClick:xx(e.onClick,()=>i.onOpenChange(!1))})}).displayName=v9;var v7='[cmdk-group=""]',ye='[cmdk-group-items=""]',yt='[cmdk-item=""]',yn=`${yt}:not([aria-disabled="true"])`,yr="cmdk-item-select",yi="data-value",ya=(e,t,n)=>{var r;return r=e,function e(t,n,r,i,a,s,o){if(s===n.length)return a===t.length?1:.99;var l=`${a},${s}`;if(void 0!==o[l])return o[l];for(var d,c,u,m,p=i.charAt(s),f=r.indexOf(p,a),h=0;f>=0;)(d=e(t,n,r,i,f+1,s+1,o))>h&&(f===a?d*=1:xm.test(t.charAt(f-1))?(d*=.8,(u=t.slice(a,f-1).match(xp))&&a>0&&(d*=Math.pow(.999,u.length))):xf.test(t.charAt(f-1))?(d*=.9,(m=t.slice(a,f-1).match(xh))&&a>0&&(d*=Math.pow(.999,m.length))):(d*=.17,a>0&&(d*=Math.pow(.999,f-a))),t.charAt(f)!==n.charAt(s)&&(d*=.9999)),(d<.1&&r.charAt(f-1)===i.charAt(s+1)||i.charAt(s+1)===i.charAt(s)&&r.charAt(f-1)!==i.charAt(s))&&.1*(c=e(t,n,r,i,f+1,s+2,o))>d&&(d=.1*c),d>h&&(h=d),f=r.indexOf(p,f+1);return o[l]=h,h}(r=n&&n.length>0?`${r+" "+n.join(" ")}`:r,t,xg(r),xg(t),0,0,{})},ys=eP.createContext(void 0),yo=eP.createContext(void 0),yl=eP.createContext(void 0),yd=eP.forwardRef((e,t)=>{let n=yy(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=yy(()=>new Set),i=yy(()=>new Map),a=yy(()=>new Map),s=yy(()=>new Set),o=yx(e),{label:l,children:d,value:c,onValueChange:u,filter:m,shouldFilter:p,loop:f,disablePointerSelection:h=!1,vimBindings:g=!0,...x}=e,v=xN(),y=xN(),b=xN(),k=eP.useRef(null),j=yj();yv(()=>{if(void 0!==c){let e=c.trim();n.current.value=e,w.emit()}},[c]),yv(()=>{j(6,E)},[]);let w=eP.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,s,l;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)I(),S(),j(1,$);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(b);e?e.focus():null==(i=document.getElementById(v))||i.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=C())?void 0:e.id,w.emit()}),r||j(5,E),(null==(a=o.current)?void 0:a.value)!==void 0){null==(l=(s=o.current).onValueChange)||l.call(s,null!=t?t:"");return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),N=eP.useMemo(()=>({value:(e,t,r)=>{var i;t!==(null==(i=a.current.get(e))?void 0:i.value)&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,_(t,r)),j(2,()=>{S(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),j(3,()=>{I(),S(),n.current.value||$(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=C();j(4,()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&$(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:k}),[]);function _(e,t){var r,i;let a=null!=(i=null==(r=o.current)?void 0:r.filter)?i:ya;return e?a(e,n.current.search,t):0}function S(){if(!n.current.search||!1===o.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{a=Math.max(e.get(t),a)}),t.push([n,a])});let r=k.current;A().sort((t,n)=>{var r,i;let a=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(i=e.get(a))?i:0)}).forEach(e=>{let t=e.closest(ye);t?t.appendChild(e.parentElement===t?e:e.closest(`${ye} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ye} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${v7}[${yi}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function $(){let e=A().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(yi);w.setState("value",t||void 0)}function I(){var e,t,s,l;if(!n.current.search||!1===o.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let d=0;for(let i of r.current){let r=_(null!=(t=null==(e=a.current.get(i))?void 0:e.value)?t:"",null!=(l=null==(s=a.current.get(i))?void 0:s.keywords)?l:[]);n.current.filtered.items.set(i,r),r>0&&d++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=d}function E(){var e,t,n;let r=C();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(v7))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function C(){var e;return null==(e=k.current)?void 0:e.querySelector(`${yt}[aria-selected="true"]`)}function A(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(yn))||[])}function T(e){let t=A()[e];t&&w.setState("value",t.getAttribute(yi))}function P(e){var t;let n=C(),r=A(),i=r.findIndex(e=>e===n),a=r[i+e];null!=(t=o.current)&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState("value",a.getAttribute(yi))}function z(e){let t=C(),n=null==t?void 0:t.closest(v7),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,v7):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,v7))?void 0:n.querySelector(yn);r?w.setState("value",r.getAttribute(yi)):P(e)}let O=()=>T(A().length-1),M=e=>{e.preventDefault(),e.metaKey?O():e.altKey?z(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?T(0):e.altKey?z(-1):P(-1)};return eP.createElement(xz.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":g&&e.ctrlKey&&M(e);break;case"ArrowDown":M(e);break;case"p":case"k":g&&e.ctrlKey&&R(e);break;case"ArrowUp":R(e);break;case"Home":e.preventDefault(),T(0);break;case"End":e.preventDefault(),O();break;case"Enter":{e.preventDefault();let t=C();if(t){let e=new Event(yr);t.dispatchEvent(e)}}}}},eP.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:yN},l),yw(e,e=>eP.createElement(yo.Provider,{value:w},eP.createElement(ys.Provider,{value:N},e))))}),yc=eP.forwardRef((e,t)=>{var n,r;let i=xN(),a=eP.useRef(null),s=eP.useContext(yl),o=eP.useContext(ys),l=yx(e),d=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==s?void 0:s.forceMount;yv(()=>{if(!d)return o.item(i,null==s?void 0:s.id)},[d]);let c=yk(i,a,[e.value,e.children,a],e.keywords),u=eP.useContext(yo),m=yb(e=>e.value&&e.value===c.current),p=yb(e=>!!d||!1===o.filter()||!e.search||e.filtered.items.get(i)>0);function f(){var e,t;h(),null==(t=(e=l.current).onSelect)||t.call(e,c.current)}function h(){u.setState("value",c.current,!0)}if(eP.useEffect(()=>{let t=a.current;if(!(!t||e.disabled))return t.addEventListener(yr,f),()=>t.removeEventListener(yr,f)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:x,onSelect:v,forceMount:y,keywords:b,...k}=e;return eP.createElement(xz.div,{ref:xy(a,t),...k,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!m,"data-disabled":!!g,"data-selected":!!m,onPointerMove:g||o.getDisablePointerSelection()?void 0:h,onClick:g?void 0:f},e.children)}),yu=eP.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,s=xN(),o=eP.useRef(null),l=eP.useRef(null),d=xN(),c=eP.useContext(ys),u=yb(e=>!!i||!1===c.filter()||!e.search||e.filtered.groups.has(s));yv(()=>c.group(s),[]),yk(s,o,[e.value,e.heading,l]);let m=eP.useMemo(()=>({id:s,forceMount:i}),[i]);return eP.createElement(xz.div,{ref:xy(o,t),...a,"cmdk-group":"",role:"presentation",hidden:!u||void 0},n&&eP.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),yw(e,e=>eP.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},eP.createElement(yl.Provider,{value:m},e))))}),ym=eP.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=eP.useRef(null),a=yb(e=>!e.search);return n||a?eP.createElement(xz.div,{ref:xy(i,t),...r,"cmdk-separator":"",role:"separator"}):null}),yp=eP.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=null!=e.value,a=eP.useContext(yo),s=yb(e=>e.search),o=yb(e=>e.selectedItemId),l=eP.useContext(ys);return eP.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),eP.createElement(xz.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:i?e.value:s,onChange:e=>{i||a.setState("search",e.target.value),null==n||n(e.target.value)}})}),yf=eP.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=eP.useRef(null),s=eP.useRef(null),o=yb(e=>e.selectedItemId),l=eP.useContext(ys);return eP.useEffect(()=>{if(s.current&&a.current){let e=s.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),eP.createElement(xz.div,{ref:xy(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:l.listId},yw(e,e=>eP.createElement("div",{ref:xy(s,l.listInnerRef),"cmdk-list-sizer":""},e)))}),yh=eP.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:s,...o}=e;return eP.createElement(vV,{open:n,onOpenChange:r},eP.createElement(vK,{container:s},eP.createElement(vY,{"cmdk-overlay":"",className:i}),eP.createElement(v1,{"aria-label":e.label,"cmdk-dialog":"",className:a},eP.createElement(yd,{ref:t,...o}))))}),yg=Object.assign(yd,{List:yf,Item:yc,Input:yp,Group:yu,Separator:ym,Dialog:yh,Empty:eP.forwardRef((e,t)=>yb(e=>0===e.filtered.count)?eP.createElement(xz.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:eP.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return eP.createElement(xz.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},yw(e,e=>eP.createElement("div",{"aria-hidden":!0},e)))})});function yx(e){let t=eP.useRef(e);return yv(()=>{t.current=e}),t}var yv="u"<typeof window?eP.useEffect:eP.useLayoutEffect;function yy(e){let t=eP.useRef();return void 0===t.current&&(t.current=e()),t}function yb(e){let t=eP.useContext(yo),n=()=>e(t.snapshot());return eP.useSyncExternalStore(t.subscribe,n,n)}function yk(e,t,n,r=[]){let i=eP.useRef(),a=eP.useContext(ys);return yv(()=>{var s;let o=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),l=r.map(e=>e.trim());a.value(e,o,l),null==(s=t.current)||s.setAttribute(yi,o),i.current=o}),i}var yj=()=>{let[e,t]=eP.useState(),n=yy(()=>new Map);return yv(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function yw({asChild:e,children:t},n){let r;return e&&eP.isValidElement(t)?eP.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var yN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.s([],53296),e.i(53296);let y_=eP.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0}),yS=function(e){let t=(0,tj.useBaseUiId)(),n=void 0===e.controlId?t:e.controlId,[r,i]=eP.useState(n),[a,s]=eP.useState(e.labelId),[o,l]=eP.useState([]),d=(0,ts.useRefWithInit)(()=>new Map),{messageIds:c}=re(),u=(0,ti.useStableCallback)((e,t)=>{let n=d.current;void 0===t?n.delete(e):(n.set(e,t),i(e=>{let t;if(0!==n.size){for(let r of n.values()){if(void 0!==e&&r===e)return e;void 0===t&&(t=r)}return t}}))}),m=eP.useCallback(e=>(0,tN.mergeProps)({"aria-describedby":c.concat(o).join(" ")||void 0},e),[c,o]),p=eP.useMemo(()=>({controlId:r,registerControlId:u,labelId:a,setLabelId:s,messageIds:o,setMessageIds:l,getDescriptionProps:m}),[r,u,a,s,o,l,m]);return(0,eT.jsx)(n7.Provider,{value:p,children:e.children})};function y$(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let yI=Object.keys(n1),yE=eP.forwardRef(function(e,t){let{errors:n,validationMode:r,submitAttemptedRef:i}=rp(),{render:a,className:s,validate:o,validationDebounceTime:l=0,validationMode:d=r,name:c,disabled:u=!1,invalid:m,dirty:p,touched:f,actionsRef:h,style:g,...x}=e,{disabled:v}=function(e=!1){let t=eP.useContext(y_);if(!t&&!e)throw Error((0,tm.default)(86));return t}(),y=(0,ti.useStableCallback)(o||(()=>null)),b=v||u,[k,j]=eP.useState(!1),[w,N]=eP.useState(!1),[_,S]=eP.useState(!1),[$,I]=eP.useState(!1),E=p??w,C=f??k,A=eP.useRef(!1),T=eP.useRef(void 0),P=eP.useCallback(()=>T.current,[]),z=eP.useCallback(e=>{T.current=e},[]),O=(0,ti.useStableCallback)(e=>{void 0===p&&(e&&(A.current=!0),N(e))}),M=(0,ti.useStableCallback)(e=>{void 0===f&&j(e)}),R=(0,ti.useStableCallback)(()=>"onChange"===d||"onSubmit"===d&&i.current),D=!!c&&Object.hasOwn(n,c)&&void 0!==n[c],L=!0===m||D,[U,Z]=eP.useState({state:n1,error:"",errors:[],value:null,initialValue:null}),F=!L&&U.state.valid,B=eP.useMemo(()=>({disabled:b,touched:C,dirty:E,valid:F,filled:_,focused:$}),[b,C,E,F,_,$]),V=function(e){let{formRef:t,clearErrors:n}=rp(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:s,invalid:o,markedDirtyRef:l,state:d,name:c,shouldValidateOnChange:u,getRegisteredFieldId:m}=e,{controlId:p,getDescriptionProps:f}=re(),h=(0,nz.useTimeout)(),g=eP.useRef(null),x=(0,ti.useStableCallback)(async(e,n=!1)=>{let s,c=g.current;if(!c)return;function f(e,n=o){let r=m()??p;if(null==r)return;let i=t.current.fields.get(r);if(!i)return;let a=y$(e,n);t.current.fields.set(r,{...i,validityData:a})}if(n){if(!1!==d.valid)return;let t=c.validity;if(!t.valueMissing){let t={value:e,state:{...n1,valid:!0},error:"",errors:[],initialValue:a.initialValue};c.setCustomValidity(""),f(t,!1),r(t);return}let n=yI.reduce((e,n)=>(e[n]=t[n],e),{});if(!n.valid&&!function(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let n of yI)"valid"!==n&&("valueMissing"===n&&(t=e[n]),e[n]&&(t=!1));return t}(n))return}h.clear();let x=null,v=[],y=function(e){let t=yI.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of yI)if("valid"!==e){if("valueMissing"===e&&t[e])n=!0;else if(t[e])return t}return n&&!l.current&&(t.valid=!0,t.valueMissing=!1),t}(c),b=u();if(c.validationMessage&&!b)s=c.validationMessage,v=[c.validationMessage];else{let n=i(e,Array.from(t.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));null!==(x="object"==typeof n&&null!==n&&"then"in n?await n:n)?(y.valid=!1,y.customError=!0,Array.isArray(x)?(v=x,c.setCustomValidity(x.join("\n"))):x&&(v=[x],c.setCustomValidity(x))):b&&(c.setCustomValidity(""),y.customError=!1,c.validationMessage?(s=c.validationMessage,v=[c.validationMessage]):c.validity.valid&&!y.valid&&(y.valid=!0))}let k={value:e,state:y,error:s??(Array.isArray(x)?x[0]:x??""),errors:v,initialValue:a.initialValue};f(k),r(k)}),v=eP.useCallback((e={})=>(0,tN.mergeProps)(f,!1===d.valid?{"aria-invalid":!0}:tU.EMPTY_OBJECT,e),[f,d.valid]),y=eP.useCallback((e={})=>(0,tN.mergeProps)({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(n(c),!u())return void x(e.currentTarget.value,!0);let t=e.currentTarget;""===t.value?x(t.value):(h.clear(),s?h.start(s,()=>{x(t.value)}):x(t.value))}},v(e)),[v,n,c,h,x,s,u]);return eP.useMemo(()=>({getValidationProps:v,getInputValidationProps:y,inputRef:g,commit:x}),[v,y,x])}({setValidityData:Z,validate:y,validityData:U,validationDebounceTime:l,invalid:L,markedDirtyRef:A,state:B,name:c,shouldValidateOnChange:R,getRegisteredFieldId:P}),q=U.value,W=eP.useCallback(()=>{A.current=!0,V.commit(q)},[V,q]),H=function(e){let{commit:t,invalid:n,markedDirtyRef:r,name:i,setRegisteredFieldId:a,setValidityData:s,validityData:o}=e,{formRef:l}=rp(),d=eP.useRef(null),c=eP.useRef(null),u=eP.useRef(null),m=(0,ti.useStableCallback)(()=>{let e=c.current;if(e)return e.getValue?e.getValue():e.value}),p=(0,ti.useStableCallback)(()=>{let e=c.current;if(!e)return;let n=e.value;void 0===n&&(n=m()),r.current=!0,t(n)});function f(e=c.current?.id){e&&l.current.fields.delete(e)}return(0,tr.useIsoLayoutEffect)(()=>{let e=c.current;e&&e.id&&l.current.fields.set(e.id,{getValue:m,name:i,controlRef:e.controlRef??u,validityData:y$(o,n),validate:p})},[l,m,n,i,p,o]),(0,tr.useIsoLayoutEffect)(()=>{let e=l.current.fields;return()=>{let t=c.current?.id;t&&e.delete(t)}},[l]),(0,ti.useStableCallback)((e,t)=>{let r;if(!t){d.current===e&&(d.current=null,f(),c.current=null,a(void 0));return}let h=c.current?.id;d.current=e,c.current=t,a(t.id),h&&h!==t.id&&f(h),function(){let e=c.current;if(!e)return;let t=e.value;void 0===t&&(t=m()),null===o.initialValue&&null!==t&&s(e=>({...e,initialValue:t}))}(),(r=c.current)&&r.id&&l.current.fields.set(r.id,{getValue:m,name:i,controlRef:r.controlRef??u,validityData:y$(o,n),validate:p})})}({commit:V.commit,invalid:L,markedDirtyRef:A,name:c,setRegisteredFieldId:z,setValidityData:Z,validityData:U});eP.useImperativeHandle(h,()=>({validate:W}),[W]);let G=eP.useMemo(()=>({invalid:L,name:c,validityData:U,setValidityData:Z,disabled:b,touched:C,setTouched:M,dirty:E,setDirty:O,filled:_,setFilled:S,focused:$,setFocused:I,validate:y,validationMode:d,validationDebounceTime:l,shouldValidateOnChange:R,state:B,markedDirtyRef:A,registerFieldControl:H,validation:V}),[L,c,U,b,C,M,E,O,_,S,$,I,y,d,l,R,B,H,V]),K=(0,ta.useRenderElement)("div",e,{ref:t,state:B,props:x,stateAttributesMapping:n5});return(0,eT.jsx)(n3.Provider,{value:G,children:K})}),yC=eP.forwardRef(function(e,t){return(0,eT.jsx)(yS,{children:(0,eT.jsx)(yE,{...e,ref:t})})}),yA=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,nativeLabel:s=!0,...o}=e,l=n9(!1),{labelId:d}=re(),c=eP.useRef(null),u=rw({id:d??a,native:s});return(0,ta.useRenderElement)("label",e,{ref:[t,c],state:l.state,props:[u,o],stateAttributesMapping:n5})}),yT={...n5,...tY.transitionStatusMapping},yP=eP.forwardRef(function(e,t){let{render:n,id:r,className:i,match:a,style:s,...o}=e,l=(0,tj.useBaseUiId)(r),{validityData:d,state:c,name:u}=n9(!1),{setMessageIds:m}=re(),{errors:p}=rp(),f=u?p[u]:null,h="string"==typeof a,g=!1;g=!0===a||(h?!!d.state[a]:!!f||!1===d.state.valid);let{mounted:x,transitionStatus:v,setMounted:y}=(0,tQ.useTransitionStatus)(g);(0,tr.useIsoLayoutEffect)(()=>{if(g&&l)return m(e=>e.concat(l)),()=>{m(e=>e.filter(e=>e!==l))}},[g,l,m]);let b=eP.useRef(null),[k,j]=eP.useState(null),[w,N]=eP.useState(null),_=d.errors.length>1?(0,eT.jsx)("ul",{children:d.errors.map(e=>(0,eT.jsx)("li",{children:e},e))}):d.error,S=h?_:f||_,$=d.error;null!=f?$=Array.isArray(f)?JSON.stringify(f):f:d.errors.length>1&&($=JSON.stringify(d.errors)),g&&$!==w&&(N($),j(S)),(0,tX.useOpenChangeComplete)({open:g,ref:b,onComplete(){g||y(!1)}});let I={...c,transitionStatus:v},E=(0,ta.useRenderElement)("div",e,{ref:[t,b],state:I,props:[{id:l,children:g?S:k},o],stateAttributesMapping:yT,enabled:x});return x?E:null}),yz=eP.forwardRef(function(e,t){let{render:n,id:r,className:i,style:a,...s}=e,o=(0,tj.useBaseUiId)(r),l=n9(!1),{setMessageIds:d}=re();return(0,tr.useIsoLayoutEffect)(()=>{if(o)return d(e=>e.concat(o)),()=>{d(e=>e.filter(e=>e!==o))}},[o,d]),(0,ta.useRenderElement)("p",e,{ref:t,state:l.state,props:[{id:o},s],stateAttributesMapping:n5})}),yO=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:s,disabled:o=!1,onValueChange:l,defaultValue:d,autoFocus:c=!1,style:u,...m}=e,{state:p,name:f,disabled:h,setTouched:g,setDirty:x,validityData:v,setFocused:y,setFilled:b,validationMode:k,validation:j}=n9(),w=h||o,N={...p,disabled:w},{labelId:_}=re(),S=rt({id:i});(0,tr.useIsoLayoutEffect)(()=>{let e=null!=s;j.inputRef.current?.value||e&&""!==s?b(!0):e&&""===s&&b(!1)},[j.inputRef,b,s]);let $=eP.useRef(null);(0,tr.useIsoLayoutEffect)(()=>{c&&$.current===(0,tM.activeElement)((0,tk.ownerDocument)($.current))&&y(!0)},[c,y]);let[I]=tn({controlled:s,default:d,name:"FieldControl",state:"value"}),E=void 0!==s,C=E?I:void 0,A=(0,ti.useStableCallback)(()=>j.inputRef.current?.value);return n8(j.inputRef,S,C,A),(0,ta.useRenderElement)("input",e,{ref:[t,$],state:N,props:[{id:S,disabled:w,name:f??a,ref:j.inputRef,"aria-labelledby":_,autoFocus:c,...E?{value:C}:{defaultValue:d},onChange(e){let t=e.currentTarget.value;l?.(t,(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent)),x(t!==v.initialValue),b(""!==t)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),"onBlur"===k&&j.commit(e.currentTarget.value)},onKeyDown(e){"INPUT"===e.currentTarget.tagName&&"Enter"===e.key&&(g(!0),j.commit(e.currentTarget.value))}},j.getInputValidationProps(),m],stateAttributesMapping:n5})}),yM=eP.createContext({disabled:!1}),yR=eP.createContext(void 0),yD=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,...s}=e,{state:o,disabled:l}=n9(!1),d=l||a,c=function(e=!0){let t=eP.useContext(yR);if(void 0===t&&!e)throw Error((0,tm.default)(3));return t}(),u=c?.allValues!==void 0?c?.parent.id:void 0,m=eP.useMemo(()=>({disabled:d}),[d]),p=(0,ta.useRenderElement)("div",e,{ref:t,state:o,props:s,stateAttributesMapping:n5});return(0,eT.jsx)(yS,{controlId:u,children:(0,eT.jsx)(yM.Provider,{value:m,children:p})})});e.s(["Control",0,yO,"Description",0,yz,"Error",0,yP,"Item",0,yD,"Label",0,yA,"Root",0,yC,"Validity",0,function(e){let{children:t}=e,{validityData:n,invalid:r}=n9(!1),i=eP.useMemo(()=>y$(n,r),[n,r]),a=!1===i.state.valid,{transitionStatus:s}=(0,tQ.useTransitionStatus)(a),o=eP.useMemo(()=>({...i,validity:i.state,transitionStatus:s}),[i,s]);return(0,eT.jsx)(eP.Fragment,{children:t(o)})}],56615);var yL=e.i(56615),yL=yL;let yU=eP.forwardRef(function(e,t){return(0,eT.jsx)(yL.Control,{ref:t,...e})});function yZ({className:e,type:t,...n}){return(0,eT.jsx)(yU,{type:t,"data-slot":"input",className:(0,ny.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}function yF({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,ny.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let yB=nv("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function yV({className:e,align:t="inline-start",...n}){return(0,eT.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,ny.cn)(yB({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}function yq({className:e,...t}){return(0,eT.jsx)(yg,{"data-slot":"command",className:(0,ny.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})}function yW({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!1,...a}){return(0,eT.jsxs)(sO,{...a,children:[(0,eT.jsxs)(sU,{className:"sr-only",children:[(0,eT.jsx)(sZ,{children:e}),(0,eT.jsx)(sF,{children:t})]}),(0,eT.jsx)(sL,{className:(0,ny.cn)("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",r),showCloseButton:i,children:n})]})}function yH({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,eT.jsxs)(yF,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,eT.jsx)(yg.Input,{"data-slot":"command-input",className:(0,ny.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,eT.jsx)(yV,{children:(0,eT.jsx)(eX,{className:"size-4 shrink-0 opacity-50"})})]})})}function yG({className:e,...t}){return(0,eT.jsx)(yg.List,{"data-slot":"command-list",className:(0,ny.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}function yK({className:e,...t}){return(0,eT.jsx)(yg.Empty,{"data-slot":"command-empty",className:(0,ny.cn)("py-6 text-center text-sm",e),...t})}function yJ({className:e,...t}){return(0,eT.jsx)(yg.Group,{"data-slot":"command-group",className:(0,ny.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})}function yY({className:e,...t}){return(0,eT.jsx)(yg.Separator,{"data-slot":"command-separator",className:(0,ny.cn)("-mx-1 h-px bg-border",e),...t})}function yX({className:e,children:t,...n}){return(0,eT.jsxs)(yg.Item,{"data-slot":"command-item",className:(0,ny.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...n,children:[t,(0,eT.jsx)(iq,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function yQ({className:e,...t}){return(0,eT.jsx)("span",{"data-slot":"command-shortcut",className:(0,ny.cn)("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",e),...t})}function y0({open:e,onOpenChange:t,tabs:n,onSelectTab:r,onRunChecks:i,report:a,insights:s}){let{resolvedTheme:o,setTheme:l}=(0,sQ.useTheme)(),{viewIssue:d}=l$(),c=(0,eP.useMemo)(()=>{let e=[];return a.lint.messages.forEach((t,n)=>e.push({id:`lint-${n}`,issue:oH(t),group:"Lint",icon:eZ})),a.types.diagnostics.forEach((t,n)=>e.push({id:`type-${n}`,issue:oG(t),group:"Types",icon:eF})),a.security.findings.forEach(t=>e.push({id:`sec-${t.id}`,issue:oK(t),group:"Security",icon:eB})),a.deps.findings.forEach(t=>e.push({id:`dep-${t.id}`,issue:oJ(t),group:"Dependencies",icon:eq})),s.database.findings.forEach(t=>e.push({id:`db-${t.id}`,issue:o0(t),group:"Database",icon:eW})),s.tests.findings.forEach(t=>e.push({id:`test-${t.id}`,issue:o6(t),group:"Tests",icon:e1})),s.performance.findings.forEach(t=>e.push({id:`perf-${t.id}`,issue:o5(t),group:"Performance",icon:e0})),s.accessibility.violations.forEach(t=>e.push({id:`a11y-${t.id}`,issue:o4(t),group:"Accessibility",icon:eQ})),s.env.variables.forEach(t=>e.push({id:`env-${t.key}`,issue:oX(t),group:"Environment",icon:eH})),s.network.calls.forEach(t=>e.push({id:`net-${t.id}`,issue:oQ(t),group:"Network",icon:eG})),s.git.issues.forEach(t=>e.push({id:`git-${t.id}`,issue:o1(t),group:"Git",icon:eK})),s.git.workflows.forEach(t=>t.issues.forEach(t=>e.push({id:`ci-${t.id}`,issue:o1(t),group:"CI/CD",icon:eK}))),e},[a,s]);function u(e){t(!1),setTimeout(e,0)}return(0,eT.jsx)(yW,{open:e,onOpenChange:t,className:"sm:!max-w-xl",children:(0,eT.jsxs)(yq,{children:[(0,eT.jsx)(yH,{placeholder:"Search issues, files, and actions…"}),(0,eT.jsxs)(yG,{children:[(0,eT.jsx)(yK,{children:"No results found."}),(0,eT.jsx)(yJ,{heading:"Go to tab",children:n.map(e=>(0,eT.jsxs)(yX,{value:`tab ${e.label}`,onSelect:()=>u(()=>r(e.value)),children:[(0,eT.jsx)(e.icon,{}),(0,eT.jsx)("span",{children:e.label})]},e.value))}),(0,eT.jsx)(yY,{}),(0,eT.jsxs)(yJ,{heading:"Actions",children:[(0,eT.jsxs)(yX,{value:"run checks analysis",onSelect:()=>u(()=>i?.()),children:[(0,eT.jsx)(i2,{}),(0,eT.jsx)("span",{children:"Run checks"}),(0,eT.jsx)(yQ,{children:"R"})]}),(0,eT.jsxs)(yX,{value:"open settings",onSelect:()=>u(()=>r("settings")),children:[(0,eT.jsx)(e5,{}),(0,eT.jsx)("span",{children:"Open settings"}),(0,eT.jsx)(yQ,{children:","})]}),(0,eT.jsxs)(yX,{value:"toggle theme dark light",onSelect:()=>u(()=>l("dark"===o?"light":"dark")),children:[(0,eT.jsx)(xu,{}),(0,eT.jsx)("span",{children:"Toggle theme"})]})]}),(0,eT.jsx)(yY,{}),(0,eT.jsx)(yJ,{heading:"Issues & findings",children:c.map(e=>{let t=oV(e.issue.severity);return(0,eT.jsxs)(yX,{value:`${e.group} ${e.issue.title} ${e.issue.filePath} ${e.issue.ruleId??""} ${e.issue.code??""}`,onSelect:()=>u(()=>d(e.issue)),children:[(0,eT.jsx)(e.icon,{}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.issue.title}),(0,eT.jsxs)("span",{className:"ml-2 flex shrink-0 items-center gap-2",children:[(0,eT.jsx)(gc,{className:(0,ny.cn)("size-3",t.text)}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.group})]})]},e.id)})})]})]})})}nv("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let y1=eL("scan-search",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);function y2({onRunChecks:e,onLoadDemo:t}){return(0,eT.jsxs)("div",{className:"flex min-h-[60svh] flex-col items-center justify-center px-4 py-16 text-center",children:[(0,eT.jsx)("div",{className:"flex size-14 items-center justify-center rounded-md border border-border bg-card text-muted-foreground",children:(0,eT.jsx)(y1,{className:"size-7"})}),(0,eT.jsx)("h2",{className:"mt-6 text-balance text-lg font-semibold text-foreground",children:"No analysis yet"}),(0,eT.jsx)("p",{className:"mt-2 max-w-md text-pretty text-sm leading-relaxed text-muted-foreground",children:"Run Projectlens against a project to populate every surface with real lint, type, security, dependency, and project-intelligence results."}),(0,eT.jsxs)("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:[(0,eT.jsxs)("button",{type:"button",onClick:e,className:"inline-flex items-center gap-2 rounded-sm bg-primary px-4 py-2 font-mono text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(i2,{className:"size-4"}),"Run checks"]}),(0,eT.jsxs)("button",{type:"button",onClick:t,className:"inline-flex items-center gap-2 rounded-sm border border-border bg-card px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(e1,{className:"size-4"}),"Load demo data"]})]}),(0,eT.jsxs)("div",{className:"mt-8 flex items-center gap-2 rounded-sm border border-border bg-secondary/40 px-3 py-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(e2,{className:"size-3.5 shrink-0"}),(0,eT.jsxs)("span",{children:["Or run ",(0,eT.jsx)("span",{className:"font-semibold text-foreground",children:"Projectlens"})," in your project directory"]})]})]})}function y4({monorepo:e,aggregate:t,selectedPackage:n,onSelect:r}){return(0,eT.jsxs)(iH,{value:n??"__aggregate__",onValueChange:e=>r("__aggregate__"===e?null:e),children:[(0,eT.jsx)(iJ,{className:"w-full",children:(0,eT.jsx)(iK,{placeholder:"All packages"})}),(0,eT.jsxs)(iY,{children:[(0,eT.jsxs)(iQ,{value:"__aggregate__",children:["All packages (",e.packages.length,") — Score: ",t.score]}),t.packageScores.map(e=>(0,eT.jsxs)(iQ,{value:e.name,children:[e.name," — ",e.score," (",e.grade,")"]},e.name))]})]})}function y5({workspace:e,onSelectPackage:t}){return(0,eT.jsxs)("div",{className:"space-y-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("h3",{className:"font-mono text-sm font-medium text-foreground",children:"Packages"}),(0,eT.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[e.monorepo.packages.length," packages · ",e.monorepo.tool]})]}),(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e.aggregate.packageScores.map(n=>{let r=e.packages[n.name],i=r?.report;return(0,eT.jsxs)("button",{type:"button",onClick:()=>t(n.name),className:"group flex flex-col items-center gap-2 rounded-xl bg-card p-4 text-left ring-1 ring-foreground/10 transition-colors hover:ring-foreground/25",children:[(0,eT.jsx)(oh,{score:n.score,grade:n.grade,size:64}),(0,eT.jsxs)("div",{className:"text-center",children:[(0,eT.jsx)("p",{className:"font-mono text-xs font-medium text-foreground truncate max-w-[180px]",children:n.name}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[i?.lint.errorCount??0," lint ·"," ",i?.types.diagnostics.length??0," types ·"," ",i?.security.findings.length??0," security"]})]})]},n.name)})})]})}let y6=eL("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),y3=eL("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),y9=eL("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),y8=eL("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),y7=eL("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]),be=eL("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);e.s([],63983),e.i(63983);let bt=eP.createContext(void 0),bn=((k={}).checked="data-checked",k.unchecked="data-unchecked",k.disabled="data-disabled",k.readonly="data-readonly",k.required="data-required",k.valid="data-valid",k.invalid="data-invalid",k.touched="data-touched",k.dirty="data-dirty",k.filled="data-filled",k.focused="data-focused",k),br={...n5,checked:e=>e?{[bn.checked]:""}:{[bn.unchecked]:""}},bi=eP.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:s,id:o,inputRef:l,name:d,nativeButton:c=!1,onCheckedChange:u,readOnly:m=!1,required:p=!1,disabled:f=!1,render:h,uncheckedValue:g,value:x,style:v,...y}=e,{clearErrors:b}=rp(),{state:k,setTouched:j,setDirty:w,validityData:N,setFilled:_,setFocused:S,shouldValidateOnChange:$,validationMode:I,disabled:E,name:C,validation:A}=n9(),{labelId:T}=re(),P=E||f,z=C??d,O=eP.useRef(null),M=(0,tC.useMergedRefs)(O,l,A.inputRef),R=eP.useRef(null),D=(0,tj.useBaseUiId)(),L=rt({id:o,implicit:!1,controlRef:R}),U=c?void 0:L,[Z,F]=tn({controlled:n,default:!!i,name:"Switch",state:"checked"});n8(R,D,Z),(0,tr.useIsoLayoutEffect)(()=>{O.current&&_(O.current.checked)},[O,_]),rf(Z,()=>{b(z),w(Z!==N.initialValue),_(Z),$()?A.commit(Z):A.commit(Z,!0)});let{getButtonProps:B,buttonRef:V}=t$({disabled:P,native:c}),q=function(e,t,n,r=!0,i){let[a,s]=eP.useState(),o=(0,tj.useBaseUiId)(i?`${i}-label`:void 0),l=e??t??a;return(0,tr.useIsoLayoutEffect)(()=>{let i=e||t||!r?void 0:function(e,t){let n=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}(n.current,o);a!==i&&s(i)}),l}(a,T,O,!c,U),W=(0,tN.mergeProps)({checked:Z,disabled:P,form:s,id:U,name:z,required:p,style:z?n$.visuallyHiddenInput:n$.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:M,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m)return void e.preventDefault();let t=e.currentTarget.checked,n=(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent);u?.(t,n),n.isCanceled||F(t)},onFocus(){R.current?.focus()}},A.getInputValidationProps,void 0!==x?{value:x}:tU.EMPTY_OBJECT),H=eP.useMemo(()=>({...k,checked:Z,disabled:P,readOnly:m,required:p}),[k,Z,P,m,p]),G=(0,ta.useRenderElement)("span",e,{state:H,ref:[t,R,V],props:[{id:c?L:D,role:"switch","aria-checked":Z,"aria-readonly":m||void 0,"aria-required":p||void 0,"aria-labelledby":q,onFocus(){P||S(!0)},onBlur(){let e=O.current;e&&!P&&(j(!0),S(!1),"onBlur"===I&&A.commit(e.checked))},onClick(e){if(m||P)return;e.preventDefault();let t=O.current;t&&t.dispatchEvent(new((0,rS.ownerWindow)(t)).PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},A.getValidationProps,y,B],stateAttributesMapping:br});return(0,eT.jsxs)(bt.Provider,{value:H,children:[G,!Z&&z&&void 0!==g&&(0,eT.jsx)("input",{type:"hidden",form:s,name:z,value:g}),(0,eT.jsx)("input",{...W,suppressHydrationWarning:!0})]})}),ba=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,s=function(){let e=eP.useContext(bt);if(void 0===e)throw Error((0,tm.default)(63));return e}();return(0,ta.useRenderElement)("span",e,{state:s,ref:t,stateAttributesMapping:br,props:a})});e.s(["Root",0,bi,"Thumb",0,ba],34344);var bs=e.i(34344),bs=bs;function bo({className:e,size:t="default",...n}){return(0,eT.jsx)(bs.Root,{"data-slot":"switch","data-size":t,className:(0,ny.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:(0,eT.jsx)(bs.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function bl({className:e,...t}){return(0,eT.jsx)("label",{"data-slot":"label",className:(0,ny.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function bd({provider:e,value:t,active:n,onChange:r}){let[i,a]=(0,eP.useState)(!1),s=t.trim().length>0,o=!e.keyPrefix||!s||t.startsWith(e.keyPrefix);return(0,eT.jsxs)("div",{className:(0,ny.cn)("flex flex-col gap-2 border-l-2 py-3 pl-4 transition-colors",n?"border-foreground":"border-border"),children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(bl,{htmlFor:`key-${e.id}`,className:"font-mono text-sm font-medium text-foreground",children:e.name}),n&&(0,eT.jsx)("span",{className:"rounded-sm border border-foreground/30 bg-foreground/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide text-foreground",children:"Active"}),s&&o&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(iq,{className:"size-3"})," set"]})]}),(0,eT.jsx)("code",{className:"font-mono text-[11px] text-muted-foreground",children:e.envVar})]}),(0,eT.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:e.blurb}),e.needsKey?(0,eT.jsx)("div",{className:"flex items-center gap-2",children:(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(yZ,{id:`key-${e.id}`,type:i?"text":"password",value:t,spellCheck:!1,autoComplete:"off",placeholder:e.keyPrefix?`${e.keyPrefix}…`:"Enter API key",onChange:e=>r(e.target.value),className:(0,ny.cn)("rounded-sm pr-9 font-mono text-sm",!o&&"border-destructive/60")}),(0,eT.jsx)("button",{type:"button",onClick:()=>a(e=>!e),"aria-label":i?"Hide key":"Show key",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground",children:i?(0,eT.jsx)(cy,{className:"size-4"}):(0,eT.jsx)(cv,{className:"size-4"})})]})}):(0,eT.jsx)(yZ,{id:`key-${e.id}`,value:t,spellCheck:!1,placeholder:"http://localhost:11434",onChange:e=>r(e.target.value),className:"rounded-sm font-mono text-sm"}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[o?(0,eT.jsx)("span",{}):(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-destructive",children:["Expected a key starting with ",e.keyPrefix]}),e.keyUrl&&(0,eT.jsxs)("a",{href:e.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:["Get key ",(0,eT.jsx)(oE,{className:"size-3"})]})]})]})}let bc=eL("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),bu=eL("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),bm=new Set(["openrouter/meta-llama/llama-3.2-90b","openrouter/meta-llama/llama-3.2-1b","openrouter/meta-llama/llama-3.1-405b-instruct","openrouter/meta-llama/llama-3-8b-instruct","openrouter/meta-llama/llama-2-13b","openrouter/openchat/openchat-3.5","openrouter/undi95/toppy-m-7b","openrouter/gryphe/mythomax-l2-13b","openrouter/cinematika/cinematika-7b"]);async function bp(){let e=await fetch("https://models.dev/api.json",{headers:{accept:"application/json"}});if(!e.ok)throw Error(`models.dev responded ${e.status}`);var t=await e.json();let n=[];for(let[e,r]of Object.entries(t)){let t=r?.name??e;for(let[i,a]of Object.entries(r?.models??{})){let r=`${e}/${i}`;n.push({id:r,modelId:i,name:a.name??i,providerId:e,providerName:t,family:a.family,reasoning:!!a.reasoning,toolCall:!!a.tool_call,attachment:!!a.attachment,openWeights:!!a.open_weights,inputModalities:a.modalities?.input??[],outputModalities:a.modalities?.output??[],contextLimit:a.limit?.context,outputLimit:a.limit?.output,knowledge:a.knowledge,releaseDate:a.release_date,lastUpdated:a.last_updated,freeOpenRouter:bm.has(r)||"openrouter"===e&&a.cost?.input===0,cost:a.cost?{input:a.cost.input,output:a.cost.output,cacheRead:a.cost.cache_read,cacheWrite:a.cost.cache_write}:void 0})}}return n.sort((e,t)=>{let n=e.releaseDate??"",r=t.releaseDate??"";return n!==r?r.localeCompare(n):e.name.localeCompare(t.name)}),n}let bf=[{id:"all",label:"All"},{id:"reasoning",label:"Reasoning"},{id:"toolCall",label:"Tools"},{id:"attachment",label:"Multimodal"},{id:"openWeights",label:"Open weights"}];function bh(e){return null==e?null:0===e?"$0":`$${e<1?e.toFixed(2):e.toFixed(2).replace(/\.00$/,"")}`}function bg({icon:e,label:t}){return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(e,{className:"size-3"}),t]})}function bx({model:e,selected:t,onSelect:n}){var r;let i=(r=e.contextLimit)?r>=1e6?`${(r/1e6).toFixed(+(r%1e6!=0))}M`:r>=1e3?`${Math.round(r/1e3)}K`:String(r):null,a=bh(e.cost?.input),s=bh(e.cost?.output);return(0,eT.jsxs)("button",{type:"button",onClick:n,className:(0,ny.cn)("flex w-full flex-col gap-2 rounded-sm border p-3 text-left transition-colors",t?"border-primary/50 bg-primary/[0.06]":"border-border bg-card hover:border-foreground/20 hover:bg-secondary/40"),children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.name}),t&&(0,eT.jsx)(iq,{className:"size-3.5 shrink-0 text-primary"})]}),(0,eT.jsx)("p",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:e.id})]}),(0,eT.jsx)("span",{className:"shrink-0 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.providerName})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.reasoning&&(0,eT.jsx)(bg,{icon:bc,label:"reasoning"}),e.toolCall&&(0,eT.jsx)(bg,{icon:s4,label:"tools"}),e.attachment&&(0,eT.jsx)(bg,{icon:bu,label:"multimodal"}),e.openWeights&&(0,eT.jsx)(bg,{icon:dD,label:"open"})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[10px] text-muted-foreground",children:[i&&(0,eT.jsxs)("span",{children:[i," ctx"]}),a&&(0,eT.jsxs)("span",{children:["in ",a,(0,eT.jsx)("span",{className:"text-muted-foreground/60",children:"/1M"})]}),s&&(0,eT.jsxs)("span",{children:["out ",s,(0,eT.jsx)("span",{className:"text-muted-foreground/60",children:"/1M"})]}),e.releaseDate&&(0,eT.jsx)("span",{children:e.releaseDate})]})]})}function bv({value:e,onChange:t,children:n,triggerClassName:r}){let[i,a]=(0,eP.useState)(!1),[s,o]=(0,eP.useState)(""),[l,d]=(0,eP.useState)("all"),{data:c,isLoading:u,error:m}=u_(i?"models.dev/catalog":null,bp,{revalidateOnFocus:!1,dedupingInterval:6e5,shouldRetryOnError:!1}),p=(0,eP.useMemo)(()=>c??[],[c]),f=(0,eP.useMemo)(()=>p.find(t=>t.id===e),[p,e]),h=(0,eP.useMemo)(()=>{let e=s.trim().toLowerCase();return p.filter(t=>("reasoning"!==l||!!t.reasoning)&&("toolCall"!==l||!!t.toolCall)&&("attachment"!==l||!!t.attachment)&&("openWeights"!==l||!!t.openWeights)&&(!e||t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.providerName.toLowerCase().includes(e)||(t.family?.toLowerCase().includes(e)??!1)))},[p,s,l]),g=(0,eP.useMemo)(()=>h.filter(e=>e.freeOpenRouter),[h]),x=(0,eP.useMemo)(()=>h.filter(e=>!e.freeOpenRouter),[h]);return(0,eT.jsxs)(sO,{open:i,onOpenChange:a,children:[n?(0,eT.jsx)(sM,{className:r,children:n}):(0,eT.jsxs)(sM,{className:"flex w-full items-center justify-between gap-2 rounded-sm border border-border bg-card px-3 py-2 text-left font-mono text-sm transition-colors hover:border-foreground/20",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e||"Select a model"}),(0,eT.jsx)(eX,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),(0,eT.jsxs)(sL,{className:"flex max-h-[80vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[(0,eT.jsxs)(sU,{className:"border-b border-border px-4 py-3",children:[(0,eT.jsxs)(sZ,{className:"flex items-center gap-2 font-mono text-sm",children:[(0,eT.jsx)(e4,{className:"size-4"}),"Choose a model"]}),(0,eT.jsx)(sF,{className:"text-xs",children:"Live catalog from models.dev — search by name, provider, or capability."})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border px-4 py-3",children:[(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{autoFocus:!0,value:s,onChange:e=>o(e.target.value),placeholder:"Search models…",className:"w-full rounded-sm border border-border bg-background py-2 pl-9 pr-8 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),s&&(0,eT.jsx)("button",{type:"button",onClick:()=>o(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:bf.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>d(e.id),className:(0,ny.cn)("rounded-sm border px-2 py-1 font-mono text-[11px] transition-colors",l===e.id?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:e.label},e.id))})]}),(0,eT.jsx)("div",{className:"min-h-0 flex-1 overflow-auto p-3",children:u?(0,eT.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 font-mono text-sm text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"}),"Loading catalog…"]}):m?(0,eT.jsx)("div",{className:"py-12 text-center font-mono text-sm text-muted-foreground",children:"Could not load the model catalog. Try again shortly."}):0===h.length?(0,eT.jsxs)("div",{className:"py-12 text-center font-mono text-sm text-muted-foreground",children:['No models match "',s,'".']}):(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[g.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-[color:var(--sev-ok)]",children:"Free on OpenRouter"}),(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 font-mono text-[10px] text-[color:var(--sev-ok)]",children:g.length})]}),(0,eT.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:g.map(n=>(0,eT.jsx)(bx,{model:n,selected:n.id===e,onSelect:()=>{t(n.id),a(!1)}},n.id))})]}),x.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[g.length>0&&(0,eT.jsx)("div",{className:"border-t border-border/50"}),(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"All models"}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:x.length})]}),(0,eT.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:x.map(n=>(0,eT.jsx)(bx,{model:n,selected:n.id===e,onSelect:()=>{t(n.id),a(!1)}},n.id))})]})]})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-border px-4 py-2.5 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{children:[h.length," models ",g.length>0&&`(${g.length} free)`]}),f&&(0,eT.jsxs)("span",{className:"truncate text-foreground",children:[f.name," selected"]})]})]})]})}async function by(e="all"){try{return(await fetch(`/api/data?scope=${e}`,{method:"DELETE"})).ok}catch{return!1}}async function bb(){await by("all"),function(){let e=[];for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);n?.startsWith("projectlens.")&&e.push(n)}for(let t of e)window.localStorage.removeItem(t)}()}async function bk(){let e=await fetch("https://ai-gateway.vercel.sh/v1/models",{headers:{accept:"application/json"}});if(!e.ok)throw Error(`Gateway responded ${e.status}`);return((await e.json()).data??[]).filter(e=>"language"===e.type).map(e=>{let t=e.context_window?`${Math.round(e.context_window/1e3)}k ctx`:void 0,n=[e.owned_by,t].filter(Boolean).join(" · ")||void 0;return{id:e.id,label:e.name?.trim()||e.id,note:n}}).sort((e,t)=>e.label.localeCompare(t.label))}function bj({icon:e,title:t,desc:n,children:r}){return(0,eT.jsxs)("section",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[(0,eT.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e,{className:"size-4"})}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground",children:t}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:n})]})]}),(0,eT.jsx)("div",{className:"px-5 py-4",children:r})]})}function bw(){let[e,t]=(0,eP.useState)(gk),[n,r]=(0,eP.useState)(!1),[i,a]=(0,eP.useState)(!1);(0,eP.useEffect)(()=>{t(gN()),a(!0)},[]);let s=gb(e.provider),o="vercel"===e.provider,{data:l,isLoading:d,mutate:c}=u_(o?"gateway/models":null,bk,{revalidateOnFocus:!1,shouldRetryOnError:!1}),u=o&&l?.length?l:s.models;function m(e){t(t=>({...t,...e})),r(!1)}function p(){t(gk),g_(gk),gw(gk.colorAccents),r(!1)}let f=(0,eP.useMemo)(()=>{let t,n,r;return JSON.stringify((t=gb(e.provider),n={},r=e.keys[e.provider],t.needsKey&&r&&(n[t.envVar]=r),e.githubToken.trim()&&(n.GITHUB_TOKEN=e.githubToken.trim()),{ai:{enabled:e.aiEnabled,provider:e.provider,model:e.model,fallbackModel:"google/gemini-2.5-flash",maxFiles:e.maxFiles,redactSecrets:e.redactSecrets},chat:{enabled:e.chatEnabled,persist:e.persistChats,model:e.model},github:{...e.defaultRepo.trim()?{defaultRepo:e.defaultRepo.trim()}:{}},env:n}),null,2)},[e]),h=s.needsKey&&!e.keys[e.provider]?.trim();return i?(0,eT.jsxs)("div",{className:"flex flex-col gap-6 lg:flex-row",children:[(0,eT.jsxs)("div",{className:"flex flex-1 flex-col gap-6",children:[(0,eT.jsx)(bj,{icon:eV,title:"AI security audit",desc:"Choose whether to run the AI review and how it handles your source.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Enable AI security audit",hint:"When off, Projectlens runs lint, types, and the dependency audit only.",checked:e.aiEnabled,onChange:e=>m({aiEnabled:e})}),(0,eT.jsx)(bN,{label:"Redact secrets before sending",hint:"Strip obvious API keys and tokens from snippets before they reach the model.",checked:e.redactSecrets,onChange:e=>m({redactSecrets:e})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Max files per run"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Caps how many source files are sent for review."})]}),(0,eT.jsxs)(iH,{value:String(e.maxFiles),onValueChange:e=>m({maxFiles:Number(e)}),children:[(0,eT.jsx)(iJ,{className:"w-24 rounded-sm font-mono",children:(0,eT.jsx)(iK,{})}),(0,eT.jsx)(iY,{children:[10,25,50,100].map(e=>(0,eT.jsx)(iQ,{value:String(e),children:e},e))})]})]})]})}),(0,eT.jsx)(bj,{icon:s3,title:"Provider & model",desc:"The provider and model used to perform the security review.",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Provider"}),(0,eT.jsxs)(iH,{value:e.provider,onValueChange:n=>{let i,a;return a=(i=gb(n)).models.some(t=>t.id===e.model),void(t(e=>({...e,provider:n,model:a?e.model:i.models[0].id})),r(!1))},children:[(0,eT.jsx)(iJ,{className:"w-full rounded-sm font-mono",children:(0,eT.jsx)(iK,{})}),(0,eT.jsx)(iY,{children:gy.map(e=>(0,eT.jsx)(iQ,{value:e.id,children:e.name},e.id))})]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Model"}),o&&(0,eT.jsxs)("button",{type:"button",onClick:()=>c(),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[d?(0,eT.jsx)(dj,{className:"size-3 animate-spin"}):(0,eT.jsx)(y9,{className:"size-3"}),d?"loading":`${u.length} live`]})]}),(0,eT.jsx)(bv,{value:e.model,onChange:e=>m({model:e})}),(0,eT.jsxs)(iH,{value:e.model??void 0,onValueChange:e=>m({model:e??""}),children:[(0,eT.jsx)(iJ,{className:"w-full rounded-sm font-mono text-xs",children:(0,eT.jsx)(iK,{placeholder:"Quick pick…"})}),(0,eT.jsx)(iY,{className:"max-h-72",children:u.map(e=>(0,eT.jsx)(iQ,{value:e.id,children:e.label},e.id))})]})]})]}),o&&(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:d?"Fetching the live model list from the AI Gateway…":l?.length?"Live text models from the Vercel AI Gateway.":"Showing built-in defaults — could not reach the gateway."}),u.find(t=>t.id===e.model)?.note&&(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:u.find(t=>t.id===e.model)?.note})]})}),(0,eT.jsx)(bj,{icon:eH,title:"API key",desc:"Stored locally in your browser and written to .projectlens.json for the CLI. Never sent anywhere else.",children:s.needsKey?(0,eT.jsx)(bd,{provider:s,value:e.keys[s.id]??"",active:!0,onChange:e=>{var n;return n=s.id,void(t(t=>({...t,keys:{...t.keys,[n]:e}})),r(!1))}},s.id):(0,eT.jsxs)("p",{className:"font-mono text-xs leading-relaxed text-muted-foreground",children:[s.name," runs locally and needs no API key. Make sure the Ollama server is running and reachable at ",(0,eT.jsx)("span",{className:"text-foreground",children:s.envVar}),"."]})}),(0,eT.jsx)(bj,{icon:e6,title:"AI chat assistant",desc:"The in-dashboard assistant available from the sidebar and every issue's “Ask AI” button.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Enable AI chat assistant",hint:"Adds the AI Chat tab and the Ask AI shortcut in issue detail sheets.",checked:e.chatEnabled,onChange:e=>m({chatEnabled:e})}),(0,eT.jsx)(bN,{label:"Persist chat history",hint:"Save conversations to .projectlens/chats.json so they survive restarts. When off, chats are kept in memory only.",checked:e.persistChats,onChange:e=>m({persistChats:e})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Assistant model"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Shared with the audit — set under Provider & model above."})]}),(0,eT.jsx)("span",{className:"max-w-[12rem] truncate rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] text-foreground",children:e.model})]})]})}),(0,eT.jsx)(bj,{icon:eK,title:"GitHub integration",desc:"Powers the enriched Git overview and the Releases dashboard. All fields are optional.",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Access token"}),(0,eT.jsx)("input",{type:"password",value:e.githubToken,onChange:e=>m({githubToken:e.target.value}),placeholder:"ghp_… (optional)",autoComplete:"off",spellCheck:!1,className:"w-full rounded-sm border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),(0,eT.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:["Raises the GitHub API rate limit from 60 to 5,000 requests/hour and enables private repositories. Written to ",(0,eT.jsx)("span",{className:"text-foreground",children:"GITHUB_TOKEN"})," for the CLI."]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Default repository"}),(0,eT.jsx)("input",{type:"text",value:e.defaultRepo,onChange:e=>m({defaultRepo:e.target.value}),placeholder:"owner/repo (optional)",autoComplete:"off",spellCheck:!1,className:"w-full rounded-sm border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),(0,eT.jsx)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:"Overrides the auto-detected remote in the Git & Releases tabs."})]})]})}),(0,eT.jsx)(bj,{icon:be,title:"Appearance",desc:"Tune how the dashboard looks. These preferences are display-only and never affect the CLI config.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Color accents",hint:"Layer subtle semantic colors over the monochrome theme — severity tags, charts, hovers, and focus rings. Takes effect immediately.",checked:e.colorAccents,onChange:function(n){gw(n);let r={...e,colorAccents:n};t(r),g_(r)}}),(0,eT.jsx)(bS,{enabled:e.colorAccents})]})}),(0,eT.jsx)(bj,{icon:e7,title:"Task board",desc:"Your remediation worklist is stored locally in this browser — it never leaves your machine or reaches the CLI.",children:(0,eT.jsx)(b_,{})}),(0,eT.jsx)(bj,{icon:y7,title:"Data & storage",desc:"Reset preferences or permanently delete stored data — runs, chats, the task board, and cached settings.",children:(0,eT.jsx)(bI,{onResetSettings:p})})]}),(0,eT.jsx)("aside",{className:"flex w-full flex-col gap-4 lg:w-80 lg:shrink-0",children:(0,eT.jsxs)("div",{className:"lg:sticky lg:top-6 flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(y6,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xs font-semibold text-foreground",children:".projectlens.json"})]}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"preview"})]}),(0,eT.jsx)("pre",{className:"max-h-80 overflow-auto px-4 py-3 font-mono text-[11px] leading-relaxed text-foreground/80",children:(0,eT.jsx)("code",{children:f})})]}),h&&(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-muted/40 px-4 py-3",children:[(0,eT.jsxs)("p",{className:"font-mono text-xs text-foreground",children:["No key for ",s.name]}),(0,eT.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Add a key above or the AI audit will be skipped at run time."})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsxs)("button",{type:"button",onClick:function(){g_(e),r(!0),window.setTimeout(()=>r(!1),2e3)},className:(0,ny.cn)("inline-flex flex-1 items-center justify-center gap-2 rounded-sm px-4 py-2.5 font-mono text-sm font-medium transition-colors",n?"bg-foreground/10 text-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"),children:[n?(0,eT.jsx)(iq,{className:"size-4"}):(0,eT.jsx)(y3,{className:"size-4"}),n?"Saved":"Save settings"]}),(0,eT.jsx)("button",{type:"button",onClick:p,"aria-label":"Reset to defaults",className:"inline-flex items-center justify-center gap-2 rounded-sm border border-border px-3 py-2.5 font-mono text-sm text-muted-foreground transition-colors hover:text-foreground",children:(0,eT.jsx)(dk,{className:"size-4"})})]})]})})]}):(0,eT.jsx)("div",{className:"h-64 animate-pulse rounded-sm border border-border bg-card/50"})}function bN({label:e,hint:t,checked:n,onChange:r}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:e}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:t})]}),(0,eT.jsx)(bo,{checked:n,onCheckedChange:r})]})}function b_(){let e=lN(lm),t=lu(),n=lN(lk),[r,i]=(0,eP.useState)(null),a=new Set(t.filter(e=>e.done).map(e=>e.id)),s=e.filter(e=>a.has(e.columnId)).length,o=[{label:"Tasks",value:e.length},{label:"Completed",value:s},{label:"Columns",value:t.length},{label:"Groups",value:n.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:o.map(e=>(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-background px-3 py-2.5",children:[(0,eT.jsx)("p",{className:"font-mono text-lg tabular-nums text-foreground",children:e.value}),(0,eT.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:e.label})]},e.label))}),(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Clear completed tasks"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Remove every task in a column marked as done."})]}),(0,eT.jsxs)("button",{type:"button",onClick:lb,disabled:0===s,className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:[(0,eT.jsx)(y8,{className:"size-3.5"}),"Clear ",s>0?s:""]})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Delete all tasks"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Empty the board. Your columns and groups are kept."})]}),"clear"===r?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>{lp([]),i(null)},className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i(null),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>i("clear"),disabled:0===e.length,className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete all"]})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Reset board to defaults"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Restore the default columns and groups and remove all tasks."})]}),"reset"===r?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>{window.localStorage.setItem(lr,JSON.stringify([])),window.localStorage.setItem(la,JSON.stringify(lt)),window.localStorage.setItem(ls,JSON.stringify(ln)),window.localStorage.removeItem(li),window.dispatchEvent(new CustomEvent(lo)),i(null)},className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i(null),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>i("reset"),className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-destructive/40 px-2.5 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",children:[(0,eT.jsx)(dk,{className:"size-3.5"}),"Reset"]})]})]})]})}function bS({enabled:e}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-3 py-3",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:"Preview"}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:e?"Color accents on":"Monochrome"})]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:[{key:"critical",label:"Critical"},{key:"high",label:"High"},{key:"medium",label:"Medium"},{key:"low",label:"Low"},{key:"info",label:"Info"},{key:"ok",label:"Passed"}].map(e=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-sm px-2 py-1 font-mono text-[11px]",style:{backgroundColor:`color-mix(in oklab, var(--sev-${e.key}) 14%, transparent)`,color:`var(--sev-${e.key})`},children:[(0,eT.jsx)("span",{className:"size-1.5 rounded-full",style:{backgroundColor:`var(--sev-${e.key})`}}),e.label]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("span",{className:"inline-flex items-center rounded-sm bg-primary px-2.5 py-1 font-mono text-[11px] text-primary-foreground",children:"Primary"}),(0,eT.jsx)("span",{className:"rounded-sm bg-accent px-2.5 py-1 font-mono text-[11px] text-accent-foreground",children:"Hover"}),(0,eT.jsx)("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(e=>(0,eT.jsx)("span",{className:"size-3 rounded-full",style:{backgroundColor:`var(--chart-${e})`}},e))})]})]})}function b$({icon:e,title:t,desc:n,actionLabel:r,busyLabel:i,onConfirm:a,tone:s="muted"}){let[o,l]=(0,eP.useState)(!1),[d,c]=(0,eP.useState)(!1);async function u(){c(!0);try{await a()}finally{c(!1),l(!1)}}return(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:t}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:n})]}),d?(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"}),i]}):o?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:u,className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>l(!1),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>l(!0),className:(0,ny.cn)("inline-flex shrink-0 items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors","destructive"===s?"border-destructive/40 text-destructive hover:bg-destructive/10":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e,{className:"size-3.5"}),r]})]})}function bI({onResetSettings:e}){return(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(b$,{icon:dk,title:"Reset settings to defaults",desc:"Restore the provider, model, AI, GitHub, and chat preferences to their defaults. Stored data is kept.",actionLabel:"Reset",busyLabel:"Resetting",onConfirm:e}),(0,eT.jsx)(b$,{icon:lW,title:"Delete run history",desc:"Remove all saved runs, the latest snapshot, and project insights from .projectlens/ on this machine.",actionLabel:"Delete runs",busyLabel:"Deleting",tone:"destructive",onConfirm:async()=>{await by("runs"),window.location.reload()}}),(0,eT.jsx)(b$,{icon:e6,title:"Delete chat history",desc:"Erase every saved Ask-AI conversation from .projectlens/chats.json.",actionLabel:"Delete chats",busyLabel:"Deleting",tone:"destructive",onConfirm:async()=>{await by("chats"),window.location.reload()}}),(0,eT.jsx)(b$,{icon:l1,title:"Delete everything",desc:"Wipe all runs, chats, the task board, and cached settings — server data and this browser's storage. This cannot be undone.",actionLabel:"Delete all data",busyLabel:"Wiping",tone:"destructive",onConfirm:async()=>{await bb(),window.location.reload()}})]})}var bE=e.i(57047),bC="vercel.ai.error",bA=Symbol.for(bC),bT=class e extends(A=Error,C=bA,A){constructor({name:e,message:t,cause:n}){super(t),this[C]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,bC)}static hasMarker(e,t){let n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}},bP="AI_APICallError",bz=`vercel.ai.error.${bP}`,bO=Symbol.for(bz),bM=class extends(P=bT,T=bO,P){constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:s,isRetryable:o=null!=r&&(408===r||409===r||429===r||r>=500),data:l}){super({name:bP,message:e,cause:s}),this[T]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=o,this.data=l}static isInstance(e){return bT.hasMarker(e,bz)}},bR="AI_EmptyResponseBodyError",bD=`vercel.ai.error.${bR}`,bL=Symbol.for(bD),bU=class extends(O=bT,z=bL,O){constructor({message:e="Empty response body"}={}){super({name:bR,message:e}),this[z]=!0}static isInstance(e){return bT.hasMarker(e,bD)}};function bZ(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var bF="AI_InvalidArgumentError",bB=`vercel.ai.error.${bF}`,bV=Symbol.for(bB),bq=class extends(R=bT,M=bV,R){constructor({message:e,cause:t,argument:n}){super({name:bF,message:e,cause:t}),this[M]=!0,this.argument=n}static isInstance(e){return bT.hasMarker(e,bB)}},bW=Symbol.for("vercel.ai.error.AI_InvalidPromptError");Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var bH="AI_JSONParseError",bG=`vercel.ai.error.${bH}`,bK=Symbol.for(bG),bJ=class extends(L=bT,D=bK,L){constructor({text:e,cause:t}){super({name:bH,message:`JSON parsing failed: Text: ${e}.
317
317
  Error message: ${bZ(t)}`,cause:t}),this[D]=!0,this.text=e}static isInstance(e){return bT.hasMarker(e,bG)}},bY=Symbol.for("vercel.ai.error.AI_LoadAPIKeyError");Symbol.for("vercel.ai.error.AI_LoadSettingError");Symbol.for("vercel.ai.error.AI_NoContentGeneratedError");Symbol.for("vercel.ai.error.AI_NoSuchModelError");Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError");var bX="AI_TypeValidationError",bQ=`vercel.ai.error.${bX}`,b0=Symbol.for(bQ),b1=class e extends(Z=bT,U=b0,Z){constructor({value:e,cause:t,context:n}){let r="Type validation failed";if((null==n?void 0:n.field)&&(r+=` for ${n.field}`),(null==n?void 0:n.entityName)||(null==n?void 0:n.entityId)){r+=" (";const e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(", "),r+=")"}super({name:bX,message:`${r}: Value: ${JSON.stringify(e)}.
318
318
  Error message: ${bZ(t)}`,cause:t}),this[U]=!0,this.value=e,this.context=n}static isInstance(e){return bT.hasMarker(e,bQ)}static wrap({value:t,cause:n,context:r}){var i,a,s;return e.isInstance(n)&&n.value===t&&(null==(i=n.context)?void 0:i.field)===(null==r?void 0:r.field)&&(null==(a=n.context)?void 0:a.entityName)===(null==r?void 0:r.entityName)&&(null==(s=n.context)?void 0:s.entityId)===(null==r?void 0:r.entityId)?n:new e({value:t,cause:n,context:r})}},b2=Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");let b4=Object.freeze({status:"aborted"});function b5(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}function s(e){var t;let i=n?.Parent?new a:this;for(let n of(r(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))n();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}let b6=Symbol("zod_brand");class b3 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class b9 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(F=globalThis).__zod_globalConfig??(F.__zod_globalConfig={});let b8=globalThis.__zod_globalConfig;function b7(e){return e&&Object.assign(b8,e),b8}function ke(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function kt(e,t="|"){return e.map(e=>kw(e)).join(t)}function kn(e,t){return"bigint"==typeof t?t.toString():t}function kr(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ki(e){return null==e}function ka(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ks(e,t){let n=e/t,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}e.s(["$ZodAsyncError",0,b3,"$ZodEncodeError",0,b9,"$brand",0,b6,"$constructor",0,b5,"NEVER",0,b4,"config",0,b7,"globalConfig",0,b8],2108);let ko=Symbol("evaluating");function kl(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ko)return void 0===r&&(r=ko,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function kd(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function kc(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ku(e){return JSON.stringify(e)}function km(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let kp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function kf(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let kh=kr(()=>{if(b8.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function kg(e){if(!1===kf(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==kf(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function kx(e){return kg(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let kv=new Set(["string","number","symbol"]),ky=new Set(["string","number","bigint","boolean","symbol","undefined"]);function kb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kk(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function kj(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function kw(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function kN(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let k_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kS={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k$(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function kI(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kE(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function kC(e){return"string"==typeof e?e:e?.message}function kA(e,t,n){let r=e.message?e.message:kC(e.inst?._zod.def?.error?.(e))??kC(t?.error?.(e))??kC(n.customError?.(e))??kC(n.localeError?.(e))??"Invalid input",{inst:i,continue:a,input:s,...o}=e;return o.path??(o.path=[]),o.message=r,t?.reportInput&&(o.input=s),o}function kT(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function kP(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function kz(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function kO(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function kM(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function kR(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}e.s(["BIGINT_FORMAT_RANGES",0,kS,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,k_,"aborted",0,k$,"allowsEval",0,kh,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,kd,"base64ToUint8Array",0,kM,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return kM(t+n)},"cached",0,kr,"captureStackTrace",0,kp,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,ka,"clone",0,kk,"cloneDef",0,function(e){return kc(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(n,r,i)=>(t??(t=e()),Reflect.get(t,r,i)),set:(n,r,i,a)=>(t??(t=e()),Reflect.set(t,r,i,a)),has:(n,r)=>(t??(t=e()),Reflect.has(t,r)),deleteProperty:(n,r)=>(t??(t=e()),Reflect.deleteProperty(t,r)),ownKeys:n=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(n,r)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)),defineProperty:(n,r,i)=>(t??(t=e()),Reflect.defineProperty(t,r,i))})},"defineLazy",0,kl,"esc",0,ku,"escapeRegex",0,kb,"explicitlyAborted",0,kI,"extend",0,function(e,t){if(!kg(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=kc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return kd(this,"shape",n),n}});return kk(e,r)},"finalizeIssue",0,kA,"floatSafeRemainder",0,ks,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,ke,"getLengthableOrigin",0,kP,"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,kT,"hexToUint8Array",0,function(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n},"isObject",0,kf,"isPlainObject",0,kg,"issue",0,kO,"joinValues",0,kt,"jsonStringifyReplacer",0,kn,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=kc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return kd(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return kk(e,n)},"mergeDefs",0,kc,"normalizeParams",0,kj,"nullish",0,ki,"numKeys",0,function(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=kc(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return kd(this,"shape",r),r},checks:[]});return kk(e,i)},"optionalKeys",0,kN,"parsedType",0,kz,"partial",0,function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=kc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return kd(this,"shape",i),i},checks:[]});return kk(t,i)},"pick",0,function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=kc(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return kd(this,"shape",e),e},checks:[]});return kk(e,i)},"prefixIssues",0,kE,"primitiveTypes",0,ky,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})},"propertyKeyTypes",0,kv,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n},"required",0,function(e,t,n){let r=kc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(let t in r)i[t]=new e({type:"nonoptional",innerType:r[t]});return kd(this,"shape",i),i}});return kk(t,r)},"safeExtend",0,function(e,t){if(!kg(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=kc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return kd(this,"shape",n),n}});return kk(e,n)},"shallowClone",0,kx,"slugify",0,km,"stringifyPrimitive",0,kw,"uint8ArrayToBase64",0,kR,"uint8ArrayToBase64url",0,function(e){return kR(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,kC],69547);let kD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kL=b5("$ZodError",kD),kU=b5("$ZodError",kD,{Parent:Error});function kZ(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function kF(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if("invalid_key"===a.code)r({issues:a.issues},[...i,...a.path]);else if("invalid_element"===a.code)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(0===e.length)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function kB(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,s;for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length){n.errors.push(t(o));continue}let r=n,l=0;for(;l<e.length;){let n=e[l],i=l===e.length-1;"string"==typeof n?(r.properties??(r.properties={}),(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??(r.items=[]),(s=r.items)[n]??(s[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(o)),l++}}};return r(e),n}function kV(e){let t=[];for(let n of e.map(e=>"object"==typeof e?e.key:e))"number"==typeof n?t.push(`[${n}]`):"symbol"==typeof n?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function kq(e){let t=[];for(let n of[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length))t.push(`✖ ${n.message}`),n.path?.length&&t.push(` → at ${kV(n.path)}`);return t.join("\n")}e.s(["$ZodError",0,kL,"$ZodRealError",0,kU,"flattenError",0,kZ,"formatError",0,kF,"prettifyError",0,kq,"toDotPath",0,kV,"treeifyError",0,kB],67416);let kW=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new b3;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>kA(e,a,b7())));throw kp(t,i?.callee),t}return s.value},kH=kW(kU),kG=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>kA(e,a,b7())));throw kp(t,i?.callee),t}return s.value},kK=kG(kU),kJ=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new b3;return a.issues.length?{success:!1,error:new(e??kL)(a.issues.map(e=>kA(e,i,b7())))}:{success:!0,data:a.value}},kY=kJ(kU),kX=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>kA(e,i,b7())))}:{success:!0,data:a.value}},kQ=kX(kU),k0=e=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kW(e)(t,n,i)},k1=k0(kU),k2=e=>(t,n,r)=>kW(e)(t,n,r),k4=k2(kU),k5=e=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kG(e)(t,n,i)},k6=k5(kU),k3=e=>async(t,n,r)=>kG(e)(t,n,r),k9=k3(kU),k8=e=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kJ(e)(t,n,i)},k7=k8(kU),je=e=>(t,n,r)=>kJ(e)(t,n,r),jt=je(kU),jn=e=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kX(e)(t,n,i)},jr=jn(kU),ji=e=>async(t,n,r)=>kX(e)(t,n,r),ja=ji(kU);e.s(["_decode",0,k2,"_decodeAsync",0,k3,"_encode",0,k0,"_encodeAsync",0,k5,"_parse",0,kW,"_parseAsync",0,kG,"_safeDecode",0,je,"_safeDecodeAsync",0,ji,"_safeEncode",0,k8,"_safeEncodeAsync",0,jn,"_safeParse",0,kJ,"_safeParseAsync",0,kX,"decode",0,k4,"decodeAsync",0,k9,"encode",0,k1,"encodeAsync",0,k6,"parse",0,kH,"parseAsync",0,kK,"safeDecode",0,jt,"safeDecodeAsync",0,ja,"safeEncode",0,k7,"safeEncodeAsync",0,jr,"safeParse",0,kY,"safeParseAsync",0,kQ],5772);let js=(e,t)=>{kL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>kF(e,t)},flatten:{value:t=>kZ(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,kn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,kn,2)}},isEmpty:{get:()=>0===e.issues.length}})},jo=b5("ZodError",js),jl=b5("ZodError",js,{Parent:Error});e.s(["ZodError",0,jo,"ZodRealError",0,jl],79163);let jd=kW(jl),jc=kG(jl),ju=kJ(jl),jm=kX(jl),jp=k0(jl),jf=k2(jl),jh=k5(jl),jg=k3(jl),jx=k8(jl),jv=je(jl),jy=jn(jl),jb=ji(jl);e.s(["decode",0,jf,"decodeAsync",0,jg,"encode",0,jp,"encodeAsync",0,jh,"parse",0,jd,"parseAsync",0,jc,"safeDecode",0,jv,"safeDecodeAsync",0,jb,"safeEncode",0,jx,"safeEncodeAsync",0,jy,"safeParse",0,ju,"safeParseAsync",0,jm],96859);let jk=Symbol("ZodOutput"),jj=Symbol("ZodInput");class jw{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function jN(){return new jw}(B=globalThis).__zod_globalRegistry??(B.__zod_globalRegistry=jN());let j_=globalThis.__zod_globalRegistry;function jS(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??j_,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function j$(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let o=e._zod.toJSONSchema?.();if(o)s.schema=o;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{let n=s.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(s.ref||(s.ref=a),j$(a,t,r),t.seen.get(a).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function jI(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:a}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i("__shared")}#/${r}/${a}`}}if(t[1]===n)return{ref:"#"};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}})(t);r.def={...r.schema},a&&(r.defId=a);let s=r.schema;for(let e in s)delete s[e];s.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
319
319