selftune 0.2.10 → 0.2.12
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.
- package/apps/local-dashboard/dist/assets/index-4_dAY17K.js +16 -0
- package/apps/local-dashboard/dist/assets/index-BxV5WZHc.css +2 -0
- package/apps/local-dashboard/dist/assets/rolldown-runtime-Dw2cE7zH.js +1 -0
- package/apps/local-dashboard/dist/assets/vendor-react-CKkiCskZ.js +11 -0
- package/apps/local-dashboard/dist/assets/vendor-table-pHbDxq36.js +8 -0
- package/apps/local-dashboard/dist/assets/vendor-ui-7xD7fNEU.js +12 -0
- package/apps/local-dashboard/dist/index.html +6 -5
- package/cli/selftune/evolution/deploy-proposal.ts +9 -239
- package/cli/selftune/evolution/evolve.ts +3 -6
- package/cli/selftune/evolution/rollback.ts +1 -1
- package/cli/selftune/routes/report.ts +1 -1
- package/cli/selftune/routes/skill-report.ts +1 -1
- package/cli/selftune/status.ts +1 -1
- package/cli/selftune/utils/frontmatter.ts +50 -7
- package/package.json +2 -2
- package/packages/ui/README.md +1 -1
- package/packages/ui/src/components/ActivityTimeline.tsx +1 -1
- package/packages/ui/src/components/section-cards.tsx +2 -2
- package/skill/SKILL.md +1 -1
- package/apps/local-dashboard/dist/assets/index-BZVLv70T.js +0 -16
- package/apps/local-dashboard/dist/assets/index-Bs3Y4ixf.css +0 -1
- package/apps/local-dashboard/dist/assets/vendor-react-BXP54cYo.js +0 -60
- package/apps/local-dashboard/dist/assets/vendor-table-DTF_SXoy.js +0 -26
- package/apps/local-dashboard/dist/assets/vendor-ui-CWU0d1wd.js +0 -341
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var Os=e=>{throw TypeError(e)};var or=(e,t,n)=>t.has(e)||Os("Cannot "+n);var g=(e,t,n)=>(or(e,t,"read from private field"),n?n.call(e):t.get(e)),q=(e,t,n)=>t.has(e)?Os("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),R=(e,t,n,r)=>(or(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),G=(e,t,n)=>(or(e,t,"access private method"),n);var Mn=(e,t,n,r)=>({set _(i){R(e,t,i,n)},get _(){return g(e,t,r)}});import{j as s,r as O,u as _l,L as wt,g as na,d as Tl,e as zl,f as Pl,B as Rl,h as Al,i as cr,k as Ol}from"./vendor-react-BXP54cYo.js";import{C as Gn,a as gt,b as Me,T as xt,c as Je,t as Ml,d as Ll,u as Wn,m as Yn,e as Xn,B as Dl,f as Fl,g as Bl,h as Jn,i as Ul,j as Hl,k as ql,M as $l,l as Vl,n as Ql,o as Kl,p as Gl,q as Wl,r as Yl,s as Xl,v as Jl,w as Zl,S as eo,x as to,y as no,z as At,A as ro,D as so,E as io,F as ao,G as lo,H as oo,I as co,J as uo,K as ho,L as fo,N as po,O as mo,P as xo,Q as go,R as bo,U as yo,V as vo,W as jo,X as wo,Y as ko,Z as No,_ as So,$ as Co,a0 as Eo,a1 as Io,a2 as _o,a3 as To,a4 as zo,a5 as ra,a6 as Po,a7 as Ro,a8 as Ao,a9 as Oo,aa as Mo,ab as Lo,ac as Do,ad as sa,ae as rn,af as Ot,ag as Ir,ah as Fo,ai as Bo,aj as Uo,ak as Ho,al as qo,am as ss,an as ia,ao as aa,ap as $o,aq as Zn,ar as er,as as la,at as qn,au as is,av as oa,aw as mn,ax as Vo,ay as Ms,az as Qo,aA as as,aB as Ko,aC as tr,aD as ca,aE as Go,aF as Wo,aG as Yo,aH as Xo,aI as Jo,aJ as Zo,aK as nr,aL as $n,aM as ec,aN as tc,aO as nc,aP as rc,aQ as ua,aR as sc,aS as ic}from"./vendor-ui-CWU0d1wd.js";import{u as ac,a as ur,b as lc,D as oc,r as cc,c as uc,f as da,S as dc,v as hc,g as fc,d as pc,e as mc,h as xc,i as gc,j as bc,s as yc,K as vc,T as jc,M as wc,k as kc,l as Nc,C as Sc}from"./vendor-table-DTF_SXoy.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const _r={HEALTHY:{icon:s.jsx(Je,{className:"size-4 text-emerald-600"}),variant:"outline",label:"Healthy"},WARNING:{icon:s.jsx(xt,{className:"size-4 text-amber-500"}),variant:"secondary",label:"Warning"},CRITICAL:{icon:s.jsx(Me,{className:"size-4 text-red-500"}),variant:"destructive",label:"Critical"},UNGRADED:{icon:s.jsx(gt,{className:"size-4 text-muted-foreground"}),variant:"secondary",label:"Ungraded"},UNKNOWN:{icon:s.jsx(Gn,{className:"size-4 text-muted-foreground/60"}),variant:"secondary",label:"Unknown"}};function ls(e,t){return t<5?"UNGRADED":e>=.8?"HEALTHY":e>=.5?"WARNING":"CRITICAL"}function dt(e){return e==null||!Number.isFinite(e)?"--":`${Math.round(e*100)}%`}function ha(e){return[...e].sort((t,n)=>{const r=t.passRate??1,i=n.passRate??1;return r!==i?r-i:n.checks-t.checks})}function _e(e){const t=new Date(e).getTime();if(Number.isNaN(t))return"--";const n=Math.max(0,Date.now()-t),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function L(...e){return Ml(Ll(e))}const Cc=Xn("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function H({className:e,variant:t="default",render:n,...r}){return Wn({defaultTagName:"span",props:Yn({className:L(Cc({variant:t}),e)},r),render:n,state:{slot:"badge",variant:t}})}const Ec=Xn("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ye({className:e,variant:t="default",size:n="default",...r}){return s.jsx(Dl,{"data-slot":"button",className:L(Ec({variant:t,size:n,className:e})),...r})}function ne({className:e,size:t="default",...n}){return s.jsx("div",{"data-slot":"card","data-size":t,className:L("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}function se({className:e,...t}){return s.jsx("div",{"data-slot":"card-header",className:L("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...t})}function ie({className:e,...t}){return s.jsx("div",{"data-slot":"card-title",className:L("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function ce({className:e,...t}){return s.jsx("div",{"data-slot":"card-description",className:L("text-sm text-muted-foreground",e),...t})}function Xe({className:e,...t}){return s.jsx("div",{"data-slot":"card-action",className:L("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function Ze({className:e,...t}){return s.jsx("div",{"data-slot":"card-content",className:L("px-4 group-data-[size=sm]/card:px-3",e),...t})}function Ls({className:e,...t}){return s.jsx(Fl,{"data-slot":"checkbox",className:L("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",e),...t,children:s.jsx(Bl,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:s.jsx(Jn,{})})})}const fa=Ul,pa=Hl,ma=ql;function Ds({...e}){return s.jsx($l,{"data-slot":"dropdown-menu",...e})}function Fs({...e}){return s.jsx(Vl,{"data-slot":"dropdown-menu-trigger",...e})}function Bs({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...a}){return s.jsx(Ql,{children:s.jsx(Kl,{className:"isolate z-50 outline-hidden",align:e,alignOffset:t,side:n,sideOffset:r,children:s.jsx(Gl,{"data-slot":"dropdown-menu-content",className:L("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...a})})})}function Ic({className:e,children:t,checked:n,inset:r,...i}){return s.jsxs(Jl,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:L("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...i,children:[s.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:s.jsx(Zl,{children:s.jsx(Jn,{})})}),t]})}function _c({...e}){return s.jsx(Wl,{"data-slot":"dropdown-menu-radio-group",...e})}function Tc({className:e,children:t,inset:n,...r}){return s.jsxs(Yl,{"data-slot":"dropdown-menu-radio-item","data-inset":n,className:L("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[s.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:s.jsx(Xl,{children:s.jsx(Jn,{})})}),t]})}function Us({className:e,...t}){return s.jsx("label",{"data-slot":"label",className:L("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})}const Hs=eo;function qs({className:e,...t}){return s.jsx(oo,{"data-slot":"select-group",className:L("scroll-my-1 p-1",e),...t})}function $s({className:e,...t}){return s.jsx(ro,{"data-slot":"select-value",className:L("flex flex-1 text-left",e),...t})}function Vs({className:e,size:t="default",children:n,...r}){return s.jsxs(to,{"data-slot":"select-trigger","data-size":t,className:L("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,s.jsx(no,{render:s.jsx(At,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Qs({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:a=0,alignItemWithTrigger:l=!0,...o}){return s.jsx(so,{children:s.jsx(io,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:l,className:"isolate z-50",children:s.jsxs(ao,{"data-slot":"select-content","data-align-trigger":l,className:L("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[s.jsx(zc,{}),s.jsx(lo,{children:t}),s.jsx(Pc,{})]})})})}function un({className:e,children:t,...n}){return s.jsxs(co,{"data-slot":"select-item",className:L("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[s.jsx(uo,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),s.jsx(ho,{render:s.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:s.jsx(Jn,{className:"pointer-events-none"})})]})}function zc({className:e,...t}){return s.jsx(fo,{"data-slot":"select-scroll-up-button",className:L("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:s.jsx(po,{})})}function Pc({className:e,...t}){return s.jsx(mo,{"data-slot":"select-scroll-down-button",className:L("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:s.jsx(At,{})})}function xa({className:e,...t}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:L("w-full caption-bottom text-sm",e),...t})})}function ga({className:e,...t}){return s.jsx("thead",{"data-slot":"table-header",className:L("[&_tr]:border-b",e),...t})}function ba({className:e,...t}){return s.jsx("tbody",{"data-slot":"table-body",className:L("[&_tr:last-child]:border-0",e),...t})}function wn({className:e,...t}){return s.jsx("tr",{"data-slot":"table-row",className:L("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Ht({className:e,...t}){return s.jsx("th",{"data-slot":"table-head",className:L("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...t})}function jt({className:e,...t}){return s.jsx("td",{"data-slot":"table-cell",className:L("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}function os({className:e,orientation:t="horizontal",...n}){return s.jsx(xo,{"data-slot":"tabs","data-orientation":t,className:L("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})}const Rc=Xn("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function cs({className:e,variant:t="default",...n}){return s.jsx(go,{"data-slot":"tabs-list","data-variant":t,className:L(Rc({variant:t}),e),...n})}function He({className:e,...t}){return s.jsx(bo,{"data-slot":"tabs-trigger",className:L("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Rt({className:e,...t}){return s.jsx(yo,{"data-slot":"tabs-content",className:L("flex-1 text-sm outline-none",e),...t})}function ya({delay:e=0,...t}){return s.jsx(vo,{"data-slot":"tooltip-provider",delay:e,...t})}function ht({...e}){return s.jsx(jo,{"data-slot":"tooltip",...e})}function ft({...e}){return s.jsx(Co,{"data-slot":"tooltip-trigger",...e})}function pt({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:a,...l}){return s.jsx(wo,{children:s.jsx(ko,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:s.jsxs(No,{"data-slot":"tooltip-content",className:L("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...l,children:[a,s.jsx(So,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}var Pn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Nt,rt,Vt,Qi,Ac=(Qi=class extends Pn{constructor(){super();q(this,Nt);q(this,rt);q(this,Vt);R(this,Vt,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,rt)||this.setEventListener(g(this,Vt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,rt))==null||t.call(this),R(this,rt,void 0))}setEventListener(t){var n;R(this,Vt,t),(n=g(this,rt))==null||n.call(this),R(this,rt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,Nt)!==t&&(R(this,Nt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,Nt)=="boolean"?g(this,Nt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Nt=new WeakMap,rt=new WeakMap,Vt=new WeakMap,Qi),us=new Ac,Oc={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},st,rs,Ki,Mc=(Ki=class{constructor(){q(this,st,Oc);q(this,rs,!1)}setTimeoutProvider(e){R(this,st,e)}setTimeout(e,t){return g(this,st).setTimeout(e,t)}clearTimeout(e){g(this,st).clearTimeout(e)}setInterval(e,t){return g(this,st).setInterval(e,t)}clearInterval(e){g(this,st).clearInterval(e)}},st=new WeakMap,rs=new WeakMap,Ki),kt=new Mc;function Lc(e){setTimeout(e,0)}var Dc=typeof window>"u"||"Deno"in globalThis;function we(){}function Fc(e,t){return typeof e=="function"?e(t):e}function Tr(e){return typeof e=="number"&&e>=0&&e!==1/0}function va(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mt(e,t){return typeof e=="function"?e(t):e}function ze(e,t){return typeof e=="function"?e(t):e}function Ks(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==ds(l,t.options))return!1}else if(!Nn(t.queryKey,l))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||a&&!a(t))}function Gs(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(kn(t.options.mutationKey)!==kn(a))return!1}else if(!Nn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ds(e,t){return((t==null?void 0:t.queryKeyHashFn)||kn)(e)}function kn(e){return JSON.stringify(e,(t,n)=>Pr(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Nn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Nn(e[n],t[n])):!1}var Bc=Object.prototype.hasOwnProperty;function ja(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Ws(e)&&Ws(t);if(!r&&!(Pr(e)&&Pr(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,c=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const h=r?d:l[d],p=e[h],f=t[h];if(p===f){c[h]=p,(r?d<a:Bc.call(e,h))&&u++;continue}if(p===null||f===null||typeof p!="object"||typeof f!="object"){c[h]=f;continue}const b=ja(p,f,n+1);c[h]=b,b===p&&u++}return a===o&&u===a?e:c}function zr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ws(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pr(e){if(!Ys(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ys(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ys(e){return Object.prototype.toString.call(e)==="[object Object]"}function Uc(e){return new Promise(t=>{kt.setTimeout(t,e)})}function Rr(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ja(e,t):t}function Hc(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function qc(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var hs=Symbol();function wa(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ka(e,t){return typeof e=="function"?e(...t):!!e}function $c(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Sn=(()=>{let e=()=>Dc;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ar(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Vc=Lc;function Qc(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=Vc;const a=o=>{t?e.push(o):i(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||l()}return c},batchCalls:o=>(...c)=>{a(()=>{o(...c)})},schedule:a,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var pe=Qc(),Qt,it,Kt,Gi,Kc=(Gi=class extends Pn{constructor(){super();q(this,Qt,!0);q(this,it);q(this,Kt);R(this,Kt,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){g(this,it)||this.setEventListener(g(this,Kt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,it))==null||t.call(this),R(this,it,void 0))}setEventListener(t){var n;R(this,Kt,t),(n=g(this,it))==null||n.call(this),R(this,it,t(this.setOnline.bind(this)))}setOnline(t){g(this,Qt)!==t&&(R(this,Qt,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,Qt)}},Qt=new WeakMap,it=new WeakMap,Kt=new WeakMap,Gi),Vn=new Kc;function Gc(e){return Math.min(1e3*2**e,3e4)}function Na(e){return(e??"online")==="online"?Vn.isOnline():!0}var Or=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Sa(e){let t=!1,n=0,r;const i=Ar(),a=()=>i.status!=="pending",l=j=>{var C;if(!a()){const y=new Or(j);p(y),(C=e.onCancel)==null||C.call(e,y)}},o=()=>{t=!0},c=()=>{t=!1},u=()=>us.isFocused()&&(e.networkMode==="always"||Vn.isOnline())&&e.canRun(),d=()=>Na(e.networkMode)&&e.canRun(),h=j=>{a()||(r==null||r(),i.resolve(j))},p=j=>{a()||(r==null||r(),i.reject(j))},f=()=>new Promise(j=>{var C;r=y=>{(a()||u())&&j(y)},(C=e.onPause)==null||C.call(e)}).then(()=>{var j;r=void 0,a()||(j=e.onContinue)==null||j.call(e)}),b=()=>{if(a())return;let j;const C=n===0?e.initialPromise:void 0;try{j=C??e.fn()}catch(y){j=Promise.reject(y)}Promise.resolve(j).then(h).catch(y=>{var w;if(a())return;const E=e.retry??(Sn.isServer()?0:3),v=e.retryDelay??Gc,N=typeof v=="function"?v(n,y):v,D=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,y);if(t||!D){p(y);return}n++,(w=e.onFail)==null||w.call(e,n,y),Uc(N).then(()=>u()?void 0:f()).then(()=>{t?p(y):b()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?b():f().then(b),i)}}var St,Wi,Ca=(Wi=class{constructor(){q(this,St)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tr(this.gcTime)&&R(this,St,kt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Sn.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,St)&&(kt.clearTimeout(g(this,St)),R(this,St,void 0))}},St=new WeakMap,Wi),Ct,Gt,Te,Et,he,En,It,Ee,Ea,Ge,Yi,Wc=(Yi=class extends Ca{constructor(t){super();q(this,Ee);q(this,Ct);q(this,Gt);q(this,Te);q(this,Et);q(this,he);q(this,En);q(this,It);R(this,It,!1),R(this,En,t.defaultOptions),this.setOptions(t.options),this.observers=[],R(this,Et,t.client),R(this,Te,g(this,Et).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,R(this,Ct,Js(this.options)),this.state=t.state??g(this,Ct),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=g(this,he))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,En),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Js(this.options);n.data!==void 0&&(this.setState(Xs(n.data,n.dataUpdatedAt)),R(this,Ct,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Te).remove(this)}setData(t,n){const r=Rr(this.state.data,t,this.options);return G(this,Ee,Ge).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){G(this,Ee,Ge).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=g(this,he))==null?void 0:r.promise;return(i=g(this,he))==null||i.cancel(t),n?n.then(we).catch(we):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,Ct)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>ze(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>mt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!va(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,he))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,he))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),g(this,Te).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(g(this,he)&&(g(this,It)||G(this,Ee,Ea).call(this)?g(this,he).cancel({revert:!0}):g(this,he).cancelRetry()),this.scheduleGc()),g(this,Te).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||G(this,Ee,Ge).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,d,h,p,f,b,j,C,y,E,v;if(this.state.fetchStatus!=="idle"&&((c=g(this,he))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,he))return g(this,he).continueRetry(),g(this,he).promise}if(t&&this.setOptions(t),!this.options.queryFn){const N=this.observers.find(D=>D.options.queryFn);N&&this.setOptions(N.options)}const r=new AbortController,i=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(R(this,It,!0),r.signal)})},a=()=>{const N=wa(this.options,n),w=(()=>{const P={client:g(this,Et),queryKey:this.queryKey,meta:this.meta};return i(P),P})();return R(this,It,!1),this.options.persister?this.options.persister(N,w,this):N(w)},o=(()=>{const N={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,Et),state:this.state,fetchFn:a};return i(N),N})();(u=this.options.behavior)==null||u.onFetch(o,this),R(this,Gt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&G(this,Ee,Ge).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta}),R(this,he,Sa({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:N=>{N instanceof Or&&N.revert&&this.setState({...g(this,Gt),fetchStatus:"idle"}),r.abort()},onFail:(N,D)=>{G(this,Ee,Ge).call(this,{type:"failed",failureCount:N,error:D})},onPause:()=>{G(this,Ee,Ge).call(this,{type:"pause"})},onContinue:()=>{G(this,Ee,Ge).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const N=await g(this,he).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(f=(p=g(this,Te).config).onSuccess)==null||f.call(p,N,this),(j=(b=g(this,Te).config).onSettled)==null||j.call(b,N,this.state.error,this),N}catch(N){if(N instanceof Or){if(N.silent)return g(this,he).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw G(this,Ee,Ge).call(this,{type:"error",error:N}),(y=(C=g(this,Te).config).onError)==null||y.call(C,N,this),(v=(E=g(this,Te).config).onSettled)==null||v.call(E,this.state.data,N,this),N}finally{this.scheduleGc()}}},Ct=new WeakMap,Gt=new WeakMap,Te=new WeakMap,Et=new WeakMap,he=new WeakMap,En=new WeakMap,It=new WeakMap,Ee=new WeakSet,Ea=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ge=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ia(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...Xs(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return R(this,Gt,t.manual?i:void 0),i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),pe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,Te).notify({query:this,type:"updated",action:t})})},Yi);function Ia(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Na(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xs(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Js(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var je,J,In,be,_t,Wt,We,at,_n,Yt,Xt,Tt,zt,lt,Jt,ee,xn,Mr,Lr,Dr,Fr,Br,Ur,Hr,_a,Xi,Yc=(Xi=class extends Pn{constructor(t,n){super();q(this,ee);q(this,je);q(this,J);q(this,In);q(this,be);q(this,_t);q(this,Wt);q(this,We);q(this,at);q(this,_n);q(this,Yt);q(this,Xt);q(this,Tt);q(this,zt);q(this,lt);q(this,Jt,new Set);this.options=n,R(this,je,t),R(this,at,null),R(this,We,Ar()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,J).addObserver(this),Zs(g(this,J),this.options)?G(this,ee,xn).call(this):this.updateResult(),G(this,ee,Fr).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qr(g(this,J),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qr(g(this,J),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,G(this,ee,Br).call(this),G(this,ee,Ur).call(this),g(this,J).removeObserver(this)}setOptions(t){const n=this.options,r=g(this,J);if(this.options=g(this,je).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ze(this.options.enabled,g(this,J))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");G(this,ee,Hr).call(this),g(this,J).setOptions(this.options),n._defaulted&&!zr(this.options,n)&&g(this,je).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,J),observer:this});const i=this.hasListeners();i&&ei(g(this,J),r,this.options,n)&&G(this,ee,xn).call(this),this.updateResult(),i&&(g(this,J)!==r||ze(this.options.enabled,g(this,J))!==ze(n.enabled,g(this,J))||mt(this.options.staleTime,g(this,J))!==mt(n.staleTime,g(this,J)))&&G(this,ee,Mr).call(this);const a=G(this,ee,Lr).call(this);i&&(g(this,J)!==r||ze(this.options.enabled,g(this,J))!==ze(n.enabled,g(this,J))||a!==g(this,lt))&&G(this,ee,Dr).call(this,a)}getOptimisticResult(t){const n=g(this,je).getQueryCache().build(g(this,je),t),r=this.createResult(n,t);return Jc(this,r)&&(R(this,be,r),R(this,Wt,this.options),R(this,_t,g(this,J).state)),r}getCurrentResult(){return g(this,be)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&g(this,We).status==="pending"&&g(this,We).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){g(this,Jt).add(t)}getCurrentQuery(){return g(this,J)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=g(this,je).defaultQueryOptions(t),r=g(this,je).getQueryCache().build(g(this,je),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return G(this,ee,xn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,be)))}createResult(t,n){var U;const r=g(this,J),i=this.options,a=g(this,be),l=g(this,_t),o=g(this,Wt),u=t!==r?t.state:g(this,In),{state:d}=t;let h={...d},p=!1,f;if(n._optimisticResults){const $=this.hasListeners(),z=!$&&Zs(t,n),k=$&&ei(t,r,n,i);(z||k)&&(h={...h,...Ia(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:j,status:C}=h;f=h.data;let y=!1;if(n.placeholderData!==void 0&&f===void 0&&C==="pending"){let $;a!=null&&a.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?($=a.data,y=!0):$=typeof n.placeholderData=="function"?n.placeholderData((U=g(this,Xt))==null?void 0:U.state.data,g(this,Xt)):n.placeholderData,$!==void 0&&(C="success",f=Rr(a==null?void 0:a.data,$,n),p=!0)}if(n.select&&f!==void 0&&!y)if(a&&f===(l==null?void 0:l.data)&&n.select===g(this,_n))f=g(this,Yt);else try{R(this,_n,n.select),f=n.select(f),f=Rr(a==null?void 0:a.data,f,n),R(this,Yt,f),R(this,at,null)}catch($){R(this,at,$)}g(this,at)&&(b=g(this,at),f=g(this,Yt),j=Date.now(),C="error");const E=h.fetchStatus==="fetching",v=C==="pending",N=C==="error",D=v&&E,w=f!==void 0,B={status:C,fetchStatus:h.fetchStatus,isPending:v,isSuccess:C==="success",isError:N,isInitialLoading:D,isLoading:D,data:f,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:j,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:E,isRefetching:E&&!v,isLoadingError:N&&!w,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:N&&w,isStale:fs(t,n),refetch:this.refetch,promise:g(this,We),isEnabled:ze(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=B.data!==void 0,z=B.status==="error"&&!$,k=_=>{z?_.reject(B.error):$&&_.resolve(B.data)},F=()=>{const _=R(this,We,B.promise=Ar());k(_)},M=g(this,We);switch(M.status){case"pending":t.queryHash===r.queryHash&&k(M);break;case"fulfilled":(z||B.data!==M.value)&&F();break;case"rejected":(!z||B.error!==M.reason)&&F();break}}return B}updateResult(){const t=g(this,be),n=this.createResult(g(this,J),this.options);if(R(this,_t,g(this,J).state),R(this,Wt,this.options),g(this,_t).data!==void 0&&R(this,Xt,g(this,J)),zr(n,t))return;R(this,be,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!g(this,Jt).size)return!0;const l=new Set(a??g(this,Jt));return this.options.throwOnError&&l.add("error"),Object.keys(g(this,be)).some(o=>{const c=o;return g(this,be)[c]!==t[c]&&l.has(c)})};G(this,ee,_a).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&G(this,ee,Fr).call(this)}},je=new WeakMap,J=new WeakMap,In=new WeakMap,be=new WeakMap,_t=new WeakMap,Wt=new WeakMap,We=new WeakMap,at=new WeakMap,_n=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,Tt=new WeakMap,zt=new WeakMap,lt=new WeakMap,Jt=new WeakMap,ee=new WeakSet,xn=function(t){G(this,ee,Hr).call(this);let n=g(this,J).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(we)),n},Mr=function(){G(this,ee,Br).call(this);const t=mt(this.options.staleTime,g(this,J));if(Sn.isServer()||g(this,be).isStale||!Tr(t))return;const r=va(g(this,be).dataUpdatedAt,t)+1;R(this,Tt,kt.setTimeout(()=>{g(this,be).isStale||this.updateResult()},r))},Lr=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,J)):this.options.refetchInterval)??!1},Dr=function(t){G(this,ee,Ur).call(this),R(this,lt,t),!(Sn.isServer()||ze(this.options.enabled,g(this,J))===!1||!Tr(g(this,lt))||g(this,lt)===0)&&R(this,zt,kt.setInterval(()=>{(this.options.refetchIntervalInBackground||us.isFocused())&&G(this,ee,xn).call(this)},g(this,lt)))},Fr=function(){G(this,ee,Mr).call(this),G(this,ee,Dr).call(this,G(this,ee,Lr).call(this))},Br=function(){g(this,Tt)&&(kt.clearTimeout(g(this,Tt)),R(this,Tt,void 0))},Ur=function(){g(this,zt)&&(kt.clearInterval(g(this,zt)),R(this,zt,void 0))},Hr=function(){const t=g(this,je).getQueryCache().build(g(this,je),this.options);if(t===g(this,J))return;const n=g(this,J);R(this,J,t),R(this,In,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_a=function(t){pe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,be))}),g(this,je).getQueryCache().notify({query:g(this,J),type:"observerResultsUpdated"})})},Xi);function Xc(e,t){return ze(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zs(e,t){return Xc(e,t)||e.state.data!==void 0&&qr(e,t,t.refetchOnMount)}function qr(e,t,n){if(ze(t.enabled,e)!==!1&&mt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fs(e,t)}return!1}function ei(e,t,n,r){return(e!==t||ze(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fs(e,n)}function fs(e,t){return ze(t.enabled,e)!==!1&&e.isStaleByTime(mt(t.staleTime,e))}function Jc(e,t){return!zr(e.getCurrentResult(),t)}function ti(e){return{onFetch:(t,n)=>{var d,h,p,f,b;const r=t.options,i=(p=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,a=((f=t.state.data)==null?void 0:f.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let j=!1;const C=v=>{$c(v,()=>t.signal,()=>j=!0)},y=wa(t.options,t.fetchOptions),E=async(v,N,D)=>{if(j)return Promise.reject();if(N==null&&v.pages.length)return Promise.resolve(v);const P=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:N,direction:D?"backward":"forward",meta:t.options.meta};return C(z),z})(),B=await y(P),{maxPages:U}=t.options,$=D?qc:Hc;return{pages:$(v.pages,B,U),pageParams:$(v.pageParams,N,U)}};if(i&&a.length){const v=i==="backward",N=v?Zc:ni,D={pages:a,pageParams:l},w=N(r,D);o=await E(D,w,v)}else{const v=e??a.length;do{const N=c===0?l[0]??r.initialPageParam:ni(r,o);if(c>0&&N==null)break;o=await E(o,N),c++}while(c<v)}return o};t.options.persister?t.fetchFn=()=>{var j,C;return(C=(j=t.options).persister)==null?void 0:C.call(j,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function ni(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Zc(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Tn,De,xe,Pt,Fe,nt,Ji,eu=(Ji=class extends Ca{constructor(t){super();q(this,Fe);q(this,Tn);q(this,De);q(this,xe);q(this,Pt);R(this,Tn,t.client),this.mutationId=t.mutationId,R(this,xe,t.mutationCache),R(this,De,[]),this.state=t.state||tu(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){g(this,De).includes(t)||(g(this,De).push(t),this.clearGcTimeout(),g(this,xe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){R(this,De,g(this,De).filter(n=>n!==t)),this.scheduleGc(),g(this,xe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,De).length||(this.state.status==="pending"?this.scheduleGc():g(this,xe).remove(this))}continue(){var t;return((t=g(this,Pt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,c,u,d,h,p,f,b,j,C,y,E,v,N,D,w,P;const n=()=>{G(this,Fe,nt).call(this,{type:"continue"})},r={client:g(this,Tn),meta:this.options.meta,mutationKey:this.options.mutationKey};R(this,Pt,Sa({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(B,U)=>{G(this,Fe,nt).call(this,{type:"failed",failureCount:B,error:U})},onPause:()=>{G(this,Fe,nt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,xe).canRun(this)}));const i=this.state.status==="pending",a=!g(this,Pt).canStart();try{if(i)n();else{G(this,Fe,nt).call(this,{type:"pending",variables:t,isPaused:a}),g(this,xe).config.onMutate&&await g(this,xe).config.onMutate(t,this,r);const U=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));U!==this.state.context&&G(this,Fe,nt).call(this,{type:"pending",context:U,variables:t,isPaused:a})}const B=await g(this,Pt).start();return await((u=(c=g(this,xe).config).onSuccess)==null?void 0:u.call(c,B,t,this.state.context,this,r)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,B,t,this.state.context,r)),await((f=(p=g(this,xe).config).onSettled)==null?void 0:f.call(p,B,null,this.state.variables,this.state.context,this,r)),await((j=(b=this.options).onSettled)==null?void 0:j.call(b,B,null,t,this.state.context,r)),G(this,Fe,nt).call(this,{type:"success",data:B}),B}catch(B){try{await((y=(C=g(this,xe).config).onError)==null?void 0:y.call(C,B,t,this.state.context,this,r))}catch(U){Promise.reject(U)}try{await((v=(E=this.options).onError)==null?void 0:v.call(E,B,t,this.state.context,r))}catch(U){Promise.reject(U)}try{await((D=(N=g(this,xe).config).onSettled)==null?void 0:D.call(N,void 0,B,this.state.variables,this.state.context,this,r))}catch(U){Promise.reject(U)}try{await((P=(w=this.options).onSettled)==null?void 0:P.call(w,void 0,B,t,this.state.context,r))}catch(U){Promise.reject(U)}throw G(this,Fe,nt).call(this,{type:"error",error:B}),B}finally{g(this,xe).runNext(this)}}},Tn=new WeakMap,De=new WeakMap,xe=new WeakMap,Pt=new WeakMap,Fe=new WeakSet,nt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),pe.batch(()=>{g(this,De).forEach(r=>{r.onMutationUpdate(t)}),g(this,xe).notify({mutation:this,type:"updated",action:t})})},Ji);function tu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ye,Oe,zn,Zi,nu=(Zi=class extends Pn{constructor(t={}){super();q(this,Ye);q(this,Oe);q(this,zn);this.config=t,R(this,Ye,new Set),R(this,Oe,new Map),R(this,zn,0)}build(t,n,r){const i=new eu({client:t,mutationCache:this,mutationId:++Mn(this,zn)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){g(this,Ye).add(t);const n=Ln(t);if(typeof n=="string"){const r=g(this,Oe).get(n);r?r.push(t):g(this,Oe).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(g(this,Ye).delete(t)){const n=Ln(t);if(typeof n=="string"){const r=g(this,Oe).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&g(this,Oe).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ln(t);if(typeof n=="string"){const r=g(this,Oe).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Ln(t);if(typeof n=="string"){const i=(r=g(this,Oe).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pe.batch(()=>{g(this,Ye).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,Ye).clear(),g(this,Oe).clear()})}getAll(){return Array.from(g(this,Ye))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Gs(n,r))}findAll(t={}){return this.getAll().filter(n=>Gs(t,n))}notify(t){pe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pe.batch(()=>Promise.all(t.map(n=>n.continue().catch(we))))}},Ye=new WeakMap,Oe=new WeakMap,zn=new WeakMap,Zi);function Ln(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Be,ea,ru=(ea=class extends Pn{constructor(t={}){super();q(this,Be);this.config=t,R(this,Be,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??ds(i,n);let l=this.get(a);return l||(l=new Wc({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){g(this,Be).has(t.queryHash)||(g(this,Be).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=g(this,Be).get(t.queryHash);n&&(t.destroy(),n===t&&g(this,Be).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return g(this,Be).get(t)}getAll(){return[...g(this,Be).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ks(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ks(t,r)):n}notify(t){pe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Be=new WeakMap,ea),oe,ot,ct,Zt,en,ut,tn,nn,ta,su=(ta=class{constructor(e={}){q(this,oe);q(this,ot);q(this,ct);q(this,Zt);q(this,en);q(this,ut);q(this,tn);q(this,nn);R(this,oe,e.queryCache||new ru),R(this,ot,e.mutationCache||new nu),R(this,ct,e.defaultOptions||{}),R(this,Zt,new Map),R(this,en,new Map),R(this,ut,0)}mount(){Mn(this,ut)._++,g(this,ut)===1&&(R(this,tn,us.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,oe).onFocus())})),R(this,nn,Vn.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,oe).onOnline())})))}unmount(){var e,t;Mn(this,ut)._--,g(this,ut)===0&&((e=g(this,tn))==null||e.call(this),R(this,tn,void 0),(t=g(this,nn))==null||t.call(this),R(this,nn,void 0))}isFetching(e){return g(this,oe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,ot).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,oe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,oe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(mt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return g(this,oe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=g(this,oe).get(r.queryHash),a=i==null?void 0:i.state.data,l=Fc(t,a);if(l!==void 0)return g(this,oe).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return pe.batch(()=>g(this,oe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,oe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,oe);pe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,oe);return pe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pe.batch(()=>g(this,oe).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(we).catch(we)}invalidateQueries(e,t={}){return pe.batch(()=>(g(this,oe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=pe.batch(()=>g(this,oe).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(we)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(we)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=g(this,oe).build(this,t);return n.isStaleByTime(mt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(we).catch(we)}fetchInfiniteQuery(e){return e.behavior=ti(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(we).catch(we)}ensureInfiniteQueryData(e){return e.behavior=ti(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vn.isOnline()?g(this,ot).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,oe)}getMutationCache(){return g(this,ot)}getDefaultOptions(){return g(this,ct)}setDefaultOptions(e){R(this,ct,e)}setQueryDefaults(e,t){g(this,Zt).set(kn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,Zt).values()],n={};return t.forEach(r=>{Nn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,en).set(kn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,en).values()],n={};return t.forEach(r=>{Nn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...g(this,ct).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ds(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===hs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,ct).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,oe).clear(),g(this,ot).clear()}},oe=new WeakMap,ot=new WeakMap,ct=new WeakMap,Zt=new WeakMap,en=new WeakMap,ut=new WeakMap,tn=new WeakMap,nn=new WeakMap,ta),Ta=O.createContext(void 0),za=e=>{const t=O.useContext(Ta);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},iu=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(Ta.Provider,{value:e,children:t})),Pa=O.createContext(!1),au=()=>O.useContext(Pa);Pa.Provider;function lu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ou=O.createContext(lu()),cu=()=>O.useContext(ou),uu=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ka(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},du=e=>{O.useEffect(()=>{e.clearReset()},[e])},hu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ka(n,[e.error,r])),fu=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},pu=(e,t)=>e.isLoading&&e.isFetching&&!t,mu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ri=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function xu(e,t,n){var p,f,b,j;const r=au(),i=cu(),a=za(),l=a.defaultQueryOptions(e);(f=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||f.call(p,l);const o=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",fu(l),uu(l,i,o),du(i);const c=!a.getQueryCache().get(l.queryHash),[u]=O.useState(()=>new t(a,l)),d=u.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(C=>{const y=h?u.subscribe(pe.batchCalls(C)):we;return u.updateResult(),y},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(l)},[l,u]),mu(l,d))throw ri(l,u,i);if(hu({result:d,errorResetBoundary:i,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw d.error;if((j=(b=a.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||j.call(b,l,d),l.experimental_prefetchInRender&&!Sn.isServer()&&pu(d,r)){const C=c?ri(l,u,i):o==null?void 0:o.promise;C==null||C.catch(we).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?d:u.trackResult(d)}function rr(e,t){return xu(e,Yc)}function gu({className:e,type:t,...n}){return s.jsx(Eo,{type:t,"data-slot":"input",className:L("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 bu({className:e,orientation:t="horizontal",...n}){return s.jsx(Io,{"data-slot":"separator",orientation:t,className:L("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}function yu({...e}){return s.jsx(_o,{"data-slot":"sheet",...e})}function vu({...e}){return s.jsx(Ao,{"data-slot":"sheet-portal",...e})}function ju({className:e,...t}){return s.jsx(Oo,{"data-slot":"sheet-overlay",className:L("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function wu({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return s.jsxs(vu,{children:[s.jsx(ju,{}),s.jsxs(To,{"data-slot":"sheet-content","data-side":n,className:L("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...i,children:[t,r&&s.jsxs(zo,{"data-slot":"sheet-close",render:s.jsx(ye,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[s.jsx(ra,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ku({className:e,...t}){return s.jsx("div",{"data-slot":"sheet-header",className:L("flex flex-col gap-0.5 p-4",e),...t})}function Nu({className:e,...t}){return s.jsx(Po,{"data-slot":"sheet-title",className:L("text-base font-medium text-foreground",e),...t})}function Su({className:e,...t}){return s.jsx(Ro,{"data-slot":"sheet-description",className:L("text-sm text-muted-foreground",e),...t})}function qe({className:e,...t}){return s.jsx("div",{"data-slot":"skeleton",className:L("animate-pulse rounded-md bg-muted",e),...t})}const dr=768;function Cu(){const[e,t]=O.useState(void 0);return O.useEffect(()=>{const n=window.matchMedia(`(max-width: ${dr-1}px)`),r=()=>{t(window.innerWidth<dr)};return n.addEventListener("change",r),t(window.innerWidth<dr),()=>n.removeEventListener("change",r)},[]),!!e}const Eu="sidebar_state",Iu=3600*24*7,_u="16rem",Tu="18rem",zu="3rem",Pu="b",Ra=O.createContext(null);function ps(){const e=O.useContext(Ra);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Ru({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...l}){const o=Cu(),[c,u]=O.useState(!1),[d,h]=O.useState(e),p=t??d,f=O.useCallback(y=>{const E=typeof y=="function"?y(p):y;n?n(E):h(E),document.cookie=`${Eu}=${E}; path=/; max-age=${Iu}`},[n,p]),b=O.useCallback(()=>o?u(y=>!y):f(y=>!y),[o,f,u]);O.useEffect(()=>{const y=E=>{E.key===Pu&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const j=p?"expanded":"collapsed",C=O.useMemo(()=>({state:j,open:p,setOpen:f,isMobile:o,openMobile:c,setOpenMobile:u,toggleSidebar:b}),[j,p,f,o,c,u,b]);return s.jsx(Ra.Provider,{value:C,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":_u,"--sidebar-width-icon":zu,...i},className:L("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...l,children:a})})}function Au({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,dir:a,...l}){const{isMobile:o,state:c,openMobile:u,setOpenMobile:d}=ps();return n==="none"?s.jsx("div",{"data-slot":"sidebar",className:L("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...l,children:i}):o?s.jsx(yu,{open:u,onOpenChange:d,...l,children:s.jsxs(wu,{dir:a,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Tu},side:e,children:[s.jsxs(ku,{className:"sr-only",children:[s.jsx(Nu,{children:"Sidebar"}),s.jsx(Su,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):s.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[s.jsx("div",{"data-slot":"sidebar-gap",className:L("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:L("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:i})})]})}function Ou({className:e,onClick:t,...n}){const{toggleSidebar:r}=ps();return s.jsxs(ye,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:L(e),onClick:i=>{t==null||t(i),r()},...n,children:[s.jsx(Mo,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Mu({className:e,...t}){return s.jsx("main",{"data-slot":"sidebar-inset",className:L("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function Lu({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:L("flex flex-col gap-2 p-2",e),...t})}function Du({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:L("flex flex-col gap-2 p-2",e),...t})}function Fu({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:L("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function hr({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:L("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Bu({className:e,render:t,...n}){return Wn({defaultTagName:"div",props:Yn({className:L("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e)},n),render:t,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function fr({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:L("w-full text-sm",e),...t})}function Dn({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:L("flex w-full min-w-0 flex-col gap-0",e),...t})}function gn({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:L("group/menu-item relative",e),...t})}const Uu=Xn("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground border-l-2 border-transparent data-active:border-primary data-active:rounded-l-none [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function bn({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:a,...l}){const{isMobile:o,state:c}=ps(),u=Wn({defaultTagName:"button",props:Yn({className:L(Uu({variant:n,size:r}),a)},l),render:i?s.jsx(ft,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return i?(typeof i=="string"&&(i={children:i}),s.jsxs(ht,{children:[u,s.jsx(pt,{side:"right",align:"center",hidden:c!=="collapsed"||o,...i})]})):u}function Hu({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:L("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",e),...t})}function qu({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:L("group/menu-sub-item relative",e),...t})}function $u({render:e,size:t="md",isActive:n=!1,className:r,...i}){return Wn({defaultTagName:"a",props:Yn({className:L("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground border-l-2 border-transparent data-active:border-primary data-active:rounded-l-none [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",r)},i),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}const Aa={HEALTHY:s.jsx(Je,{className:"size-3.5 text-emerald-600"}),WARNING:s.jsx(xt,{className:"size-3.5 text-amber-500"}),CRITICAL:s.jsx(Me,{className:"size-3.5 text-red-500"}),UNGRADED:s.jsx(gt,{className:"size-3.5 text-muted-foreground"}),UNKNOWN:s.jsx(Gn,{className:"size-3.5 text-muted-foreground/60"})},Vu={project:{label:"Project",icon:s.jsx(Bo,{className:"size-4"})},global:{label:"Global",icon:s.jsx(Ir,{className:"size-4"})},system:{label:"System",icon:s.jsx(Fo,{className:"size-4"})},admin:{label:"Admin",icon:s.jsx(Ir,{className:"size-4"})},unknown:{label:"Unknown",icon:s.jsx(Gn,{className:"size-4"})}};function Qu({scope:e,skills:t,pathname:n,defaultOpen:r}){const i=Vu[e]??{label:e,icon:s.jsx(Ir,{className:"size-4"})},a=t.some(c=>n===`/skills/${encodeURIComponent(c.name)}`),[l,o]=O.useState(r||a);return O.useEffect(()=>{a&&o(!0)},[a]),s.jsx(fa,{open:l,onOpenChange:o,className:"group/collapsible",children:s.jsxs(gn,{children:[s.jsxs(pa,{render:s.jsx(bn,{tooltip:i.label}),children:[i.icon,s.jsx("span",{children:i.label}),s.jsx(H,{variant:"secondary",className:"ml-auto h-4 px-1.5 text-[10px]",children:t.length}),s.jsx(Ot,{className:"ml-1 size-4 shrink-0 transition-transform duration-200 group-data-[open]/collapsible:rotate-90"})]}),s.jsx(ma,{children:s.jsx(Hu,{children:t.map(c=>{const u=n===`/skills/${encodeURIComponent(c.name)}`;return s.jsx(qu,{children:s.jsxs($u,{isActive:u,render:s.jsx(wt,{to:`/skills/${encodeURIComponent(c.name)}`}),children:[Aa[c.status],s.jsx("span",{className:"truncate",children:c.name}),s.jsx(H,{variant:c.status==="CRITICAL"?"destructive":c.status==="HEALTHY"?"outline":"secondary",className:"ml-auto h-4 text-[10px] px-1.5 shrink-0",children:dt(c.passRate)})]})},c.name)})})})]})})}function Ku({skills:e,search:t,onSearchChange:n,version:r,...i}){const a=_l(),l=O.useMemo(()=>{const c={};for(const p of e){const f=p.scope??"unknown";c[f]||(c[f]=[]),c[f].push(p)}const u=["global","project","system","admin","unknown"],d=u.filter(p=>{var f;return(f=c[p])==null?void 0:f.length}).map(p=>({scope:p,skills:c[p]})),h=Object.keys(c).filter(p=>!u.includes(p)).sort().map(p=>({scope:p,skills:c[p]}));return[...d,...h]},[e]),o=l.length>1;return s.jsxs(Au,{collapsible:"offcanvas",...i,children:[s.jsx(Lu,{children:s.jsx(Dn,{children:s.jsx(gn,{children:s.jsxs(bn,{className:"data-[slot=sidebar-menu-button]:!p-1.5",render:s.jsx(wt,{to:"/"}),children:[s.jsx("div",{className:"size-5 bg-current",style:{mask:"url(/logo.svg) center/contain no-repeat",WebkitMask:"url(/logo.svg) center/contain no-repeat"},"aria-hidden":"true"}),s.jsxs("span",{className:"text-base font-semibold",children:["self",s.jsx("span",{className:"text-primary-accent",children:"tune"})]})]})})})}),s.jsxs(Fu,{children:[s.jsx(hr,{children:s.jsx(fr,{children:s.jsxs("div",{className:"relative",children:[s.jsx(Lo,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(gu,{"aria-label":"Filter skills",placeholder:"Filter skills...",value:t,onChange:c=>n(c.target.value),className:"h-8 pl-8 text-sm"})]})})}),s.jsx(hr,{children:s.jsx(fr,{children:s.jsx(Dn,{children:s.jsx(gn,{children:s.jsxs(bn,{isActive:a.pathname==="/",tooltip:"Dashboard",render:s.jsx(wt,{to:"/"}),children:[s.jsx(Do,{className:"size-4"}),s.jsx("span",{children:"Dashboard"})]})})})})}),s.jsxs(hr,{className:"flex-1",children:[s.jsx(Bu,{children:"Skills"}),s.jsx(fr,{children:s.jsxs(Dn,{children:[o?l.map(({scope:c,skills:u})=>s.jsx(Qu,{scope:c,skills:u,pathname:a.pathname,defaultOpen:c==="global"||c==="project"},c)):e.map(c=>{const u=a.pathname===`/skills/${encodeURIComponent(c.name)}`;return s.jsx(gn,{children:s.jsxs(bn,{isActive:u,tooltip:`${c.name} — ${dt(c.passRate)}`,render:s.jsx(wt,{to:`/skills/${encodeURIComponent(c.name)}`}),children:[Aa[c.status],s.jsx("span",{className:"truncate",children:c.name}),s.jsx(H,{variant:c.status==="CRITICAL"?"destructive":c.status==="HEALTHY"?"outline":"secondary",className:"ml-auto h-4 text-[10px] px-1.5 shrink-0",children:dt(c.passRate)})]})},c.name)}),e.length===0&&s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No skills match"})]})})]})]}),s.jsxs(Du,{children:[s.jsx(Dn,{children:s.jsx(gn,{children:s.jsxs(bn,{isActive:a.pathname==="/status",tooltip:"System Status",render:s.jsx(wt,{to:"/status"}),children:[s.jsx(sa,{className:"size-4"}),s.jsx("span",{children:"System Status"})]})})}),s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 text-xs text-muted-foreground",children:[s.jsx(rn,{className:"size-3"}),s.jsxs("span",{children:["selftune",r?` v${r}`:""]})]})]})]})}function Gu(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.workspace_root=="string"&&typeof t.git_sha=="string"&&typeof t.db_path=="string"&&typeof t.process_mode=="string"&&(t.watcher_mode==="wal"||t.watcher_mode==="jsonl"||t.watcher_mode==="none")}function Wu(){const[e,t]=O.useState(null);if(O.useEffect(()=>{fetch("/api/health").then(r=>r.json()).then(r=>{Gu(r)&&t(r)}).catch(()=>{})},[]),!e)return null;const n=e.watcher_mode==="jsonl";return s.jsx("footer",{className:"fixed bottom-0 left-0 right-0 z-10 border-t border-border/40 bg-background/80 backdrop-blur-sm px-4 py-1.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-[11px] font-mono text-muted-foreground",children:[s.jsx("span",{title:"Workspace root",children:e.workspace_root}),s.jsx("span",{title:"Git SHA",children:e.git_sha}),s.jsx("span",{title:"Database path",children:e.db_path}),s.jsxs("span",{title:"Process mode",children:["mode: ",e.process_mode]}),s.jsxs("span",{title:"Watcher mode",className:n?"text-amber-700 dark:text-amber-300":void 0,children:["watcher: ",e.watcher_mode]}),n&&s.jsx("span",{className:"rounded border border-amber-300/70 bg-amber-500/10 px-2 py-0.5 text-amber-800 dark:border-amber-800 dark:text-amber-300",title:"Dashboard reads SQLite, but live invalidation still comes from JSONL log watchers.",children:"warning: legacy JSONL watcher invalidation"})]})})}const Oa=O.createContext(void 0),Ma="selftune-theme",Yu=["dark","light","system"];function Xu(e){const t=localStorage.getItem(Ma);return Yu.includes(t)?t:e}function Ju({children:e,defaultTheme:t="dark"}){const[n,r]=O.useState(()=>Xu(t));return O.useEffect(()=>{const i=window.document.documentElement,a=window.matchMedia("(prefers-color-scheme: dark)"),l=o=>{i.classList.remove("light","dark"),i.classList.add(o)};if(n==="system"){const o=()=>l(a.matches?"dark":"light");return o(),a.addEventListener("change",o),()=>a.removeEventListener("change",o)}l(n)},[n]),s.jsx(Oa.Provider,{value:{theme:n,setTheme:i=>{localStorage.setItem(Ma,i),r(i)}},children:e})}function Zu(){const e=O.useContext(Oa);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function ed(){const{theme:e,setTheme:t}=Zu();return s.jsxs(ye,{variant:"ghost",size:"icon",className:"relative size-8",onClick:()=>t(e==="dark"?"light":"dark"),children:[s.jsx(Uo,{className:"size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s.jsx(Ho,{className:"absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),s.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function ms(){return s.jsx("header",{className:"flex h-10 shrink-0 items-center gap-2 bg-background transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-10",children:s.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:px-6",children:[s.jsx(Ou,{className:"-ml-1"}),s.jsx(bu,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),s.jsx("div",{className:"ml-auto",children:s.jsx(ed,{})})]})})}const sr="";async function td(){const e=await fetch(`${sr}/api/v2/overview`);if(!e.ok)throw new Error(`API error: ${e.status} ${e.statusText}`);return e.json()}async function nd(e){const t=await fetch(`${sr}/api/v2/skills/${encodeURIComponent(e)}`);if(!t.ok)throw t.status===404?new La(e):new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function rd(e=20){const t=await fetch(`${sr}/api/v2/orchestrate-runs?limit=${e}`);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function sd(){const e=await fetch(`${sr}/api/v2/doctor`);if(!e.ok)throw new Error(`API error: ${e.status} ${e.statusText}`);return e.json()}class La extends Error{constructor(t){super(`Skill "${t}" not found`),this.name="NotFoundError"}}const id=6e4;function ad(){return rr({queryKey:["overview"],queryFn:td,staleTime:5e3,refetchInterval:id})}function ld(){const e=za();O.useEffect(()=>{const t=new EventSource("/api/v2/events");return t.addEventListener("update",()=>{e.invalidateQueries()}),t.onerror=()=>{},()=>{t.close()}},[e])}const si={created:"outline",validated:"secondary",deployed:"default",rejected:"destructive",rolled_back:"destructive",pending:"secondary"};function od({evolution:e,pendingProposals:t,unmatchedQueries:n,onSelectProposal:r}){return e.length>0||t.length>0||n.length>0?s.jsxs(ne,{children:[s.jsxs(se,{children:[s.jsxs(ie,{className:"flex items-center gap-2 text-sm",children:[s.jsx(rn,{className:"size-4"}),"Activity"]}),s.jsx(ce,{children:"Recent evolution events and queries"})]}),s.jsx(Ze,{children:s.jsxs(os,{defaultValue:t.length>0?"pending":e.length>0?"timeline":"unmatched",children:[s.jsx(ya,{children:s.jsxs(cs,{className:"w-full",children:[t.length>0&&s.jsxs(ht,{children:[s.jsxs(ft,{render:s.jsx(He,{value:"pending",className:"flex-1 gap-1.5"}),children:[s.jsx(qo,{className:"size-3.5"}),s.jsx(H,{variant:"secondary",className:"h-4 px-1 text-[10px]",children:t.length})]}),s.jsx(pt,{children:"Pending proposals"})]}),s.jsxs(ht,{children:[s.jsx(ft,{render:s.jsx(He,{value:"timeline",className:"flex-1"}),children:s.jsx(ss,{className:"size-3.5"})}),s.jsx(pt,{children:"Timeline"})]}),n.length>0&&s.jsxs(ht,{children:[s.jsxs(ft,{render:s.jsx(He,{value:"unmatched",className:"flex-1 gap-1.5"}),children:[s.jsx(ia,{className:"size-3.5"}),s.jsx(H,{variant:"destructive",className:"h-4 px-1 text-[10px]",children:n.length})]}),s.jsx(pt,{children:"Unmatched queries"})]})]})}),t.length>0&&s.jsx(Rt,{value:"pending",className:"mt-4 space-y-3",children:t.slice(0,10).map(a=>s.jsxs("button",{type:"button",onClick:()=>{a.skill_name&&r&&r(a.skill_name,a.proposal_id)},disabled:!a.skill_name||!r,className:"flex w-full gap-3 rounded-md p-1.5 text-left transition-colors enabled:hover:bg-accent/40 disabled:cursor-default",children:[s.jsx("div",{className:"mt-1 size-2 shrink-0 rounded-full bg-amber-400"}),s.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{variant:si[a.action]??"secondary",className:"text-[10px]",children:a.action}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:_e(a.timestamp)})]}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.details}),a.skill_name&&s.jsxs("span",{className:"text-[10px] text-muted-foreground/60 font-mono",children:[a.skill_name," · #",a.proposal_id.slice(0,8)]})]})]},a.proposal_id))}),s.jsxs(Rt,{value:"timeline",className:"mt-4 space-y-3",children:[e.slice(0,30).map((a,l)=>s.jsxs("button",{type:"button",onClick:()=>{a.skill_name&&r&&r(a.skill_name,a.proposal_id)},disabled:!a.skill_name||!r,className:"flex w-full gap-3 rounded-md p-1.5 text-left transition-colors enabled:hover:bg-accent/40 disabled:cursor-default",children:[s.jsx("div",{className:`mt-1 size-2 shrink-0 rounded-full ${a.action==="deployed"?"bg-emerald-500":a.action==="rejected"||a.action==="rolled_back"?"bg-red-500":a.action==="validated"?"bg-amber-400":"bg-primary-accent"}`}),s.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{variant:si[a.action]??"secondary",className:"text-[10px]",children:a.action}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:_e(a.timestamp)})]}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.details}),s.jsxs("span",{className:"text-[10px] text-muted-foreground/60 font-mono",children:[a.skill_name?`${a.skill_name} · `:"","#",a.proposal_id.slice(0,8)]})]})]},`${a.proposal_id}-${l}`)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No timeline events"})]}),n.length>0&&s.jsx(Rt,{value:"unmatched",className:"mt-4 space-y-2",children:n.slice(0,15).map((a,l)=>s.jsxs("div",{className:"flex gap-3",children:[s.jsx("div",{className:"mt-1 size-2 shrink-0 rounded-full bg-muted-foreground/40"}),s.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:_e(a.timestamp)}),s.jsx("p",{className:"text-xs font-mono text-foreground/80 line-clamp-2",children:a.query})]})]},`${a.session_id}-${l}`))})]})})]}):s.jsxs(ne,{children:[s.jsx(se,{children:s.jsxs(ie,{className:"flex items-center gap-2 text-sm",children:[s.jsx(rn,{className:"size-4"}),"Activity"]})}),s.jsx(Ze,{children:s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No recent activity"})})]})}function cd(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ud=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dd=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hd={};function ii(e,t){return(hd.jsx?dd:ud).test(e)}const fd=/[ \t\n\f\r]/g;function pd(e){return typeof e=="object"?e.type==="text"?ai(e.value):!1:ai(e)}function ai(e){return e.replace(fd,"")===""}class Rn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Rn.prototype.normal={};Rn.prototype.property={};Rn.prototype.space=void 0;function Da(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Rn(n,r,t)}function $r(e){return e.toLowerCase()}class Ne{constructor(t,n){this.attribute=n,this.property=t}}Ne.prototype.attribute="";Ne.prototype.booleanish=!1;Ne.prototype.boolean=!1;Ne.prototype.commaOrSpaceSeparated=!1;Ne.prototype.commaSeparated=!1;Ne.prototype.defined=!1;Ne.prototype.mustUseProperty=!1;Ne.prototype.number=!1;Ne.prototype.overloadedBoolean=!1;Ne.prototype.property="";Ne.prototype.spaceSeparated=!1;Ne.prototype.space=void 0;let md=0;const K=Mt(),ue=Mt(),Vr=Mt(),I=Mt(),re=Mt(),qt=Mt(),Ce=Mt();function Mt(){return 2**++md}const Qr=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:ue,commaOrSpaceSeparated:Ce,commaSeparated:qt,number:I,overloadedBoolean:Vr,spaceSeparated:re},Symbol.toStringTag,{value:"Module"})),pr=Object.keys(Qr);class xs extends Ne{constructor(t,n,r,i){let a=-1;if(super(t,n),li(this,"space",i),typeof r=="number")for(;++a<pr.length;){const l=pr[a];li(this,pr[a],(r&Qr[l])===Qr[l])}}}xs.prototype.defined=!0;function li(e,t,n){n&&(e[t]=n)}function sn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new xs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[$r(r)]=r,n[$r(a.attribute)]=r}return new Rn(t,n,e.space)}const Fa=sn({properties:{ariaActiveDescendant:null,ariaAtomic:ue,ariaAutoComplete:null,ariaBusy:ue,ariaChecked:ue,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:re,ariaCurrent:null,ariaDescribedBy:re,ariaDetails:null,ariaDisabled:ue,ariaDropEffect:re,ariaErrorMessage:null,ariaExpanded:ue,ariaFlowTo:re,ariaGrabbed:ue,ariaHasPopup:null,ariaHidden:ue,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:re,ariaLevel:I,ariaLive:null,ariaModal:ue,ariaMultiLine:ue,ariaMultiSelectable:ue,ariaOrientation:null,ariaOwns:re,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:ue,ariaReadOnly:ue,ariaRelevant:null,ariaRequired:ue,ariaRoleDescription:re,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:ue,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ba(e,t){return t in e?e[t]:t}function Ua(e,t){return Ba(e,t.toLowerCase())}const xd=sn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qt,acceptCharset:re,accessKey:re,action:null,allow:null,allowFullScreen:K,allowPaymentRequest:K,allowUserMedia:K,alt:null,as:null,async:K,autoCapitalize:null,autoComplete:re,autoFocus:K,autoPlay:K,blocking:re,capture:null,charSet:null,checked:K,cite:null,className:re,cols:I,colSpan:null,content:null,contentEditable:ue,controls:K,controlsList:re,coords:I|qt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:K,defer:K,dir:null,dirName:null,disabled:K,download:Vr,draggable:ue,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:K,formTarget:null,headers:re,height:I,hidden:Vr,high:I,href:null,hrefLang:null,htmlFor:re,httpEquiv:re,id:null,imageSizes:null,imageSrcSet:null,inert:K,inputMode:null,integrity:null,is:null,isMap:K,itemId:null,itemProp:re,itemRef:re,itemScope:K,itemType:re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:K,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:K,muted:K,name:null,nonce:null,noModule:K,noValidate:K,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:K,optimum:I,pattern:null,ping:re,placeholder:null,playsInline:K,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:K,referrerPolicy:null,rel:re,required:K,reversed:K,rows:I,rowSpan:I,sandbox:re,scope:null,scoped:K,seamless:K,selected:K,shadowRootClonable:K,shadowRootDelegatesFocus:K,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:ue,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:K,useMap:null,value:ue,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:re,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:K,declare:K,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:K,noHref:K,noShade:K,noWrap:K,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:ue,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:K,disableRemotePlayback:K,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:Ua}),gd=sn({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",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:Ce,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:re,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:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:K,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,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:qt,g2:qt,glyphName:qt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:Ce,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,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:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ce,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ce,rev:Ce,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ce,requiredFeatures:Ce,requiredFonts:Ce,requiredFormats:Ce,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:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:Ce,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ce,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ce,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ba}),Ha=sn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),qa=sn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ua}),$a=sn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bd={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"},yd=/[A-Z]/g,oi=/-[a-z]/g,vd=/^data[-\w.:]+$/i;function jd(e,t){const n=$r(t);let r=t,i=Ne;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&vd.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(oi,kd);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!oi.test(a)){let l=a.replace(yd,wd);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=xs}return new i(r,t)}function wd(e){return"-"+e.toLowerCase()}function kd(e){return e.charAt(1).toUpperCase()}const Nd=Da([Fa,xd,Ha,qa,$a],"html"),gs=Da([Fa,gd,Ha,qa,$a],"svg");function Sd(e){return e.join(" ").trim()}var Bt={},mr,ci;function Cd(){if(ci)return mr;ci=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
2
|
-
`,u="/",d="*",h="",p="comment",f="declaration";function b(C,y){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];y=y||{};var E=1,v=1;function N(M){var _=M.match(t);_&&(E+=_.length);var W=M.lastIndexOf(c);v=~W?M.length-W:v+M.length}function D(){var M={line:E,column:v};return function(_){return _.position=new w(M),U(),_}}function w(M){this.start=M,this.end={line:E,column:v},this.source=y.source}w.prototype.content=C;function P(M){var _=new Error(y.source+":"+E+":"+v+": "+M);if(_.reason=M,_.filename=y.source,_.line=E,_.column=v,_.source=C,!y.silent)throw _}function B(M){var _=M.exec(C);if(_){var W=_[0];return N(W),C=C.slice(W.length),_}}function U(){B(n)}function $(M){var _;for(M=M||[];_=z();)_!==!1&&M.push(_);return M}function z(){var M=D();if(!(u!=C.charAt(0)||d!=C.charAt(1))){for(var _=2;h!=C.charAt(_)&&(d!=C.charAt(_)||u!=C.charAt(_+1));)++_;if(_+=2,h===C.charAt(_-1))return P("End of comment missing");var W=C.slice(2,_-2);return v+=2,N(W),C=C.slice(_),v+=2,M({type:p,comment:W})}}function k(){var M=D(),_=B(r);if(_){if(z(),!B(i))return P("property missing ':'");var W=B(a),le=M({type:f,property:j(_[0].replace(e,h)),value:W?j(W[0].replace(e,h)):h});return B(l),le}}function F(){var M=[];$(M);for(var _;_=k();)_!==!1&&(M.push(_),$(M));return M}return U(),F()}function j(C){return C?C.replace(o,h):h}return mr=b,mr}var ui;function Ed(){if(ui)return Bt;ui=1;var e=Bt&&Bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=n;const t=e(Cd());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),o=typeof i=="function";return l.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:d}=c;o?i(u,d,c):d&&(a=a||{},a[u]=d)}),a}return Bt}var dn={},di;function Id(){if(di)return dn;di=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||n.test(u)||e.test(u)},l=function(u,d){return d.toUpperCase()},o=function(u,d){return"".concat(d,"-")},c=function(u,d){return d===void 0&&(d={}),a(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(i,o):u=u.replace(r,o),u.replace(t,l))};return dn.camelCase=c,dn}var hn,hi;function _d(){if(hi)return hn;hi=1;var e=hn&&hn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Ed()),n=Id();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(o,c){o&&c&&(l[(0,n.camelCase)(o,a)]=c)}),l}return r.default=r,hn=r,hn}var Td=_d();const zd=na(Td),Va=Qa("end"),bs=Qa("start");function Qa(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Pd(e){const t=bs(e),n=Va(e);if(t&&n)return{start:t,end:n}}function yn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fi(e.position):"start"in e||"end"in e?fi(e):"line"in e||"column"in e?Kr(e):""}function Kr(e){return pi(e&&e.line)+":"+pi(e&&e.column)}function fi(e){return Kr(e&&e.start)+"-"+Kr(e&&e.end)}function pi(e){return e&&typeof e=="number"?e:1}class ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=yn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ge.prototype.file="";ge.prototype.name="";ge.prototype.reason="";ge.prototype.message="";ge.prototype.stack="";ge.prototype.column=void 0;ge.prototype.line=void 0;ge.prototype.ancestors=void 0;ge.prototype.cause=void 0;ge.prototype.fatal=void 0;ge.prototype.place=void 0;ge.prototype.ruleId=void 0;ge.prototype.source=void 0;const ys={}.hasOwnProperty,Rd=new Map,Ad=/[A-Z]/g,Od=new Set(["table","tbody","thead","tfoot","tr"]),Md=new Set(["td","th"]),Ka="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ld(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Vd(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$d(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gs:Nd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ga(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ga(e,t,n){if(t.type==="element")return Dd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Fd(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ud(e,t,n);if(t.type==="mdxjsEsm")return Bd(e,t);if(t.type==="root")return Hd(e,t,n);if(t.type==="text")return qd(e,t)}function Dd(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=gs,e.schema=i),e.ancestors.push(t);const a=Ya(e,t.tagName,!1),l=Qd(e,t);let o=js(e,t);return Od.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!pd(c):!0})),Wa(e,l,a,t),vs(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Fd(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Cn(e,t.position)}function Bd(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cn(e,t.position)}function Ud(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=gs,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:Ya(e,t.name,!0),l=Kd(e,t),o=js(e,t);return Wa(e,l,a,t),vs(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Hd(e,t,n){const r={};return vs(r,js(e,t)),e.create(t,e.Fragment,r,n)}function qd(e,t){return t.value}function Wa(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function vs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $d(e,t,n){return r;function r(i,a,l,o){const u=Array.isArray(l.children)?n:t;return o?u(a,l,o):u(a,l)}}function Vd(e,t){return n;function n(r,i,a,l){const o=Array.isArray(a.children),c=bs(r);return t(i,a,l,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Qd(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ys.call(t.properties,i)){const a=Gd(e,i,t.properties[i]);if(a){const[l,o]=a;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&Md.has(t.tagName)?r=o:n[l]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Kd(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Cn(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else Cn(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function js(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Rd;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;l=c+"-"+u,i.set(c,u+1)}}const o=Ga(e,a,l);o!==void 0&&n.push(o)}return n}function Gd(e,t,n){const r=jd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?cd(n):Sd(n)),r.property==="style"){let i=typeof n=="object"?n:Wd(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Yd(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?bd[r.property]||r.property:r.attribute,n]}}function Wd(e,t){try{return zd(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ge("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ka+"#cannot-parse-style-attribute",i}}function Ya(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const o=ii(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=l}else r=ii(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ys.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Cn(e)}function Cn(e,t){const n=new ge("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=Ka+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yd(e){const t={};let n;for(n in e)ys.call(e,n)&&(t[Xd(n)]=e[n]);return t}function Xd(e){let t=e.replace(Ad,Jd);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Jd(e){return"-"+e.toLowerCase()}const xr={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"]},Zd={};function eh(e,t){const n=Zd,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Xa(e,r,i)}function Xa(e,t,n){if(th(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mi(e.children,t,n)}return Array.isArray(e)?mi(e,t,n):""}function mi(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Xa(e[i],t,n);return r.join("")}function th(e){return!!(e&&typeof e=="object")}const xi=document.createElement("i");function ws(e){const t="&"+e+";";xi.innerHTML=t;const n=xi.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $e(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Pe(e,t){return e.length>0?($e(e,e.length,0,t),e):t}const gi={}.hasOwnProperty;function nh(e){const t={};let n=-1;for(;++n<e.length;)rh(t,e[n]);return t}function rh(e,t){let n;for(n in t){const i=(gi.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){gi.call(i,l)||(i[l]=[]);const o=a[l];sh(i[l],Array.isArray(o)?o:o?[o]:[])}}}function sh(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$e(e,0,0,r)}function Ja(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function $t(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ue=bt(/[A-Za-z]/),Ie=bt(/[\dA-Za-z]/),ih=bt(/[#-'*+\--9=?A-Z^-~]/);function Gr(e){return e!==null&&(e<32||e===127)}const Wr=bt(/\d/),ah=bt(/[\dA-Fa-f]/),lh=bt(/[!-/:-@[-`{-~]/);function V(e){return e!==null&&e<-2}function ke(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const oh=bt(new RegExp("\\p{P}|\\p{S}","u")),ch=bt(/\s/);function bt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function an(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Ie(e.charCodeAt(n+1))&&Ie(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(l=String.fromCharCode(a,o),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ae(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(c){return Z(c)?(e.enter(n),o(c)):t(c)}function o(c){return Z(c)&&a++<i?(e.consume(c),o):(e.exit(n),t(c))}}const uh={tokenize:dh};function dh(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ae(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return V(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),l)}}const hh={tokenize:fh},bi={tokenize:ph};function fh(e){const t=this,n=[];let r=0,i,a,l;return o;function o(v){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,c,u)(v)}return u(v)}function c(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const N=t.events.length;let D=N,w;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){w=t.events[D][1].end;break}y(r);let P=N;for(;P<t.events.length;)t.events[P][1].end={...w},P++;return $e(t.events,D+1,0,t.events.slice(N)),t.events.length=P,u(v)}return o(v)}function u(v){if(r===n.length){if(!i)return p(v);if(i.currentConstruct&&i.currentConstruct.concrete)return b(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bi,d,h)(v)}function d(v){return i&&E(),y(r),p(v)}function h(v){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,b(v)}function p(v){return t.containerState={},e.attempt(bi,f,b)(v)}function f(v){return r++,n.push([t.currentConstruct,t.containerState]),p(v)}function b(v){if(v===null){i&&E(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),j(v)}function j(v){if(v===null){C(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return V(v)?(e.consume(v),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),j)}function C(v,N){const D=t.sliceStream(v);if(N&&D.push(null),v.previous=a,a&&(a.next=v),a=v,i.defineSkip(v.start),i.write(D),t.parser.lazy[v.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<l&&(!i.events[w][1].end||i.events[w][1].end.offset>l))return;const P=t.events.length;let B=P,U,$;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(U){$=t.events[B][1].end;break}U=!0}for(y(r),w=P;w<t.events.length;)t.events[w][1].end={...$},w++;$e(t.events,B+1,0,t.events.slice(P)),t.events.length=w}}function y(v){let N=n.length;for(;N-- >v;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=v}function E(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ph(e,t,n){return ae(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yi(e){if(e===null||ke(e)||ch(e))return 1;if(oh(e))return 2}function ks(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Yr={name:"attention",resolveAll:mh,tokenize:xh};function mh(e,t){let n=-1,r,i,a,l,o,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};vi(h,-c),vi(p,c),l={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Pe(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Pe(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),u=Pe(u,ks(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Pe(u,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Pe(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,$e(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function xh(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yi(r);let a;return l;function l(c){return a=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===a)return e.consume(c),o;const u=e.exit("attentionSequence"),d=yi(c),h=!d||d===2&&i||n.includes(c),p=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?h:h&&(i||!p)),u._close=!!(a===42?p:p&&(d||!h)),t(c)}}function vi(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const gh={name:"autolink",tokenize:bh};function bh(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(f){return Ue(f)?(e.consume(f),l):f===64?n(f):u(f)}function l(f){return f===43||f===45||f===46||Ie(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||Ie(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Gr(f)?n(f):(e.consume(f),c)}function u(f){return f===64?(e.consume(f),d):ih(f)?(e.consume(f),u):n(f)}function d(f){return Ie(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||Ie(f))&&r++<63){const b=f===45?p:h;return e.consume(f),b}return n(f)}}const ir={partial:!0,tokenize:yh};function yh(e,t,n){return r;function r(a){return Z(a)?ae(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||V(a)?t(a):n(a)}}const Za={continuation:{tokenize:jh},exit:wh,name:"blockQuote",tokenize:vh};function vh(e,t,n){const r=this;return i;function i(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Z(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function jh(e,t,n){const r=this;return i;function i(l){return Z(l)?ae(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Za,t,n)(l)}}function wh(e){e.exit("blockQuote")}const el={name:"characterEscape",tokenize:kh};function kh(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return lh(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const tl={name:"characterReference",tokenize:Nh};function Nh(e,t,n){const r=this;let i=0,a,l;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,l=Ie,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=ah,d):(e.enter("characterReferenceValue"),a=7,l=Wr,d(h))}function d(h){if(h===59&&i){const p=e.exit("characterReferenceValue");return l===Ie&&!ws(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&i++<a?(e.consume(h),d):n(h)}}const ji={partial:!0,tokenize:Ch},wi={concrete:!0,name:"codeFenced",tokenize:Sh};function Sh(e,t,n){const r=this,i={partial:!0,tokenize:D};let a=0,l=0,o;return c;function c(w){return u(w)}function u(w){const P=r.events[r.events.length-1];return a=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(w)}function d(w){return w===o?(l++,e.consume(w),d):l<3?n(w):(e.exit("codeFencedFenceSequence"),Z(w)?ae(e,h,"whitespace")(w):h(w))}function h(w){return w===null||V(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(ji,j,N)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||V(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(w)):Z(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ae(e,f,"whitespace")(w)):w===96&&w===o?n(w):(e.consume(w),p)}function f(w){return w===null||V(w)?h(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(w))}function b(w){return w===null||V(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(w)):w===96&&w===o?n(w):(e.consume(w),b)}function j(w){return e.attempt(i,N,C)(w)}function C(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return a>0&&Z(w)?ae(e,E,"linePrefix",a+1)(w):E(w)}function E(w){return w===null||V(w)?e.check(ji,j,N)(w):(e.enter("codeFlowValue"),v(w))}function v(w){return w===null||V(w)?(e.exit("codeFlowValue"),E(w)):(e.consume(w),v)}function N(w){return e.exit("codeFenced"),t(w)}function D(w,P,B){let U=0;return $;function $(_){return w.enter("lineEnding"),w.consume(_),w.exit("lineEnding"),z}function z(_){return w.enter("codeFencedFence"),Z(_)?ae(w,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):k(_)}function k(_){return _===o?(w.enter("codeFencedFenceSequence"),F(_)):B(_)}function F(_){return _===o?(U++,w.consume(_),F):U>=l?(w.exit("codeFencedFenceSequence"),Z(_)?ae(w,M,"whitespace")(_):M(_)):B(_)}function M(_){return _===null||V(_)?(w.exit("codeFencedFence"),P(_)):B(_)}}}function Ch(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gr={name:"codeIndented",tokenize:Ih},Eh={partial:!0,tokenize:_h};function Ih(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ae(e,a,"linePrefix",5)(u)}function a(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?c(u):V(u)?e.attempt(Eh,l,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||V(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function _h(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):V(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):ae(e,a,"linePrefix",5)(l)}function a(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):V(l)?i(l):n(l)}}const Th={name:"codeText",previous:Ph,resolve:zh,tokenize:Rh};function zh(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ph(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Rh(e,t,n){let r=0,i,a;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(a=e.enter("codeTextSequence"),i=0,d(h)):V(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||V(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",u(h))}}class Ah{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&fn(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);fn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fn(this.left,n.reverse())}}}function fn(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 nl(e){const t={};let n=-1,r,i,a,l,o,c,u;const d=new Ah(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Oh(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=d.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return $e(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Oh(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,c=[],u={};let d,h,p=-1,f=n,b=0,j=0;const C=[j];for(;f;){for(;e.get(++i)[1]!==f;);a.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&l.defineSkip(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(d),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(j=p+1,C.push(j),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):C.pop(),p=C.length;p--;){const y=o.slice(C[p],C[p+1]),E=a.pop();c.push([E,E+y.length-1]),e.splice(E,2,y)}for(c.reverse(),p=-1;++p<c.length;)u[b+c[p][0]]=b+c[p][1],b+=c[p][1]-c[p][0]-1;return u}const Mh={resolve:Dh,tokenize:Fh},Lh={partial:!0,tokenize:Bh};function Dh(e){return nl(e),e}function Fh(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):V(o)?e.check(Lh,l,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Bh(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ae(e,a,"linePrefix")}function a(l){if(l===null||V(l))return n(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function rl(e,t,n,r,i,a,l,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),p):y===null||y===32||y===41||Gr(y)?n(y):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),j(y))}function p(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(o),p(y)):y===null||y===60||V(y)?n(y):(e.consume(y),y===92?b:f)}function b(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function j(y){return!d&&(y===null||y===41||ke(y))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,j):y===41?(e.consume(y),d--,j):y===null||y===32||y===40||Gr(y)?n(y):(e.consume(y),y===92?C:j)}function C(y){return y===40||y===41||y===92?(e.consume(y),j):j(y)}}function sl(e,t,n,r,i,a){const l=this;let o=0,c;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(a),d}function d(f){return o>999||f===null||f===91||f===93&&!c||f===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(a),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||V(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),c||(c=!Z(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function il(e,t,n,r,i,a){let l;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,c):n(p)}function c(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(a),u(p))}function u(p){return p===l?(e.exit(a),c(l)):p===null?n(p):V(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ae(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||V(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?h:d)}function h(p){return p===l||p===92?(e.consume(p),d):d(p)}}function vn(e,t){let n;return r;function r(i){return V(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Z(i)?ae(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Uh={name:"definition",tokenize:qh},Hh={partial:!0,tokenize:$h};function qh(e,t,n){const r=this;let i;return a;function a(f){return e.enter("definition"),l(f)}function l(f){return sl.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=$t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return ke(f)?vn(e,u)(f):u(f)}function u(f){return rl(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(Hh,h,h)(f)}function h(f){return Z(f)?ae(e,p,"whitespace")(f):p(f)}function p(f){return f===null||V(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function $h(e,t,n){return r;function r(o){return ke(o)?vn(e,i)(o):n(o)}function i(o){return il(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return Z(o)?ae(e,l,"whitespace")(o):l(o)}function l(o){return o===null||V(o)?t(o):n(o)}}const Vh={name:"hardBreakEscape",tokenize:Qh};function Qh(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return V(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Kh={name:"headingAtx",resolve:Gh,tokenize:Wh};function Gh(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$e(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Wh(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||ke(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||V(d)?(e.exit("atxHeading"),t(d)):Z(d)?ae(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||ke(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const Yh=["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"],ki=["pre","script","style","textarea"],Xh={concrete:!0,name:"htmlFlow",resolveTo:ef,tokenize:tf},Jh={partial:!0,tokenize:rf},Zh={partial:!0,tokenize:nf};function ef(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(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}function tf(e,t,n){const r=this;let i,a,l,o,c;return u;function u(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),h}function h(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),a=!0,j):x===63?(e.consume(x),i=3,r.interrupt?t:m):Ue(x)?(e.consume(x),l=String.fromCharCode(x),C):n(x)}function p(x){return x===45?(e.consume(x),i=2,f):x===91?(e.consume(x),i=5,o=0,b):Ue(x)?(e.consume(x),i=4,r.interrupt?t:m):n(x)}function f(x){return x===45?(e.consume(x),r.interrupt?t:m):n(x)}function b(x){const Re="CDATA[";return x===Re.charCodeAt(o++)?(e.consume(x),o===Re.length?r.interrupt?t:k:b):n(x)}function j(x){return Ue(x)?(e.consume(x),l=String.fromCharCode(x),C):n(x)}function C(x){if(x===null||x===47||x===62||ke(x)){const Re=x===47,yt=l.toLowerCase();return!Re&&!a&&ki.includes(yt)?(i=1,r.interrupt?t(x):k(x)):Yh.includes(l.toLowerCase())?(i=6,Re?(e.consume(x),y):r.interrupt?t(x):k(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?E(x):v(x))}return x===45||Ie(x)?(e.consume(x),l+=String.fromCharCode(x),C):n(x)}function y(x){return x===62?(e.consume(x),r.interrupt?t:k):n(x)}function E(x){return Z(x)?(e.consume(x),E):$(x)}function v(x){return x===47?(e.consume(x),$):x===58||x===95||Ue(x)?(e.consume(x),N):Z(x)?(e.consume(x),v):$(x)}function N(x){return x===45||x===46||x===58||x===95||Ie(x)?(e.consume(x),N):D(x)}function D(x){return x===61?(e.consume(x),w):Z(x)?(e.consume(x),D):v(x)}function w(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),c=x,P):Z(x)?(e.consume(x),w):B(x)}function P(x){return x===c?(e.consume(x),c=null,U):x===null||V(x)?n(x):(e.consume(x),P)}function B(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||ke(x)?D(x):(e.consume(x),B)}function U(x){return x===47||x===62||Z(x)?v(x):n(x)}function $(x){return x===62?(e.consume(x),z):n(x)}function z(x){return x===null||V(x)?k(x):Z(x)?(e.consume(x),z):n(x)}function k(x){return x===45&&i===2?(e.consume(x),W):x===60&&i===1?(e.consume(x),le):x===62&&i===4?(e.consume(x),me):x===63&&i===3?(e.consume(x),m):x===93&&i===5?(e.consume(x),Y):V(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Jh,Ve,F)(x)):x===null||V(x)?(e.exit("htmlFlowData"),F(x)):(e.consume(x),k)}function F(x){return e.check(Zh,M,Ve)(x)}function M(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),_}function _(x){return x===null||V(x)?F(x):(e.enter("htmlFlowData"),k(x))}function W(x){return x===45?(e.consume(x),m):k(x)}function le(x){return x===47?(e.consume(x),l="",A):k(x)}function A(x){if(x===62){const Re=l.toLowerCase();return ki.includes(Re)?(e.consume(x),me):k(x)}return Ue(x)&&l.length<8?(e.consume(x),l+=String.fromCharCode(x),A):k(x)}function Y(x){return x===93?(e.consume(x),m):k(x)}function m(x){return x===62?(e.consume(x),me):x===45&&i===2?(e.consume(x),m):k(x)}function me(x){return x===null||V(x)?(e.exit("htmlFlowData"),Ve(x)):(e.consume(x),me)}function Ve(x){return e.exit("htmlFlow"),t(x)}}function nf(e,t,n){const r=this;return i;function i(l){return V(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function rf(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ir,t,n)}}const sf={name:"htmlText",tokenize:af};function af(e,t,n){const r=this;let i,a,l;return o;function o(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),c}function c(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),D):m===63?(e.consume(m),v):Ue(m)?(e.consume(m),B):n(m)}function u(m){return m===45?(e.consume(m),d):m===91?(e.consume(m),a=0,b):Ue(m)?(e.consume(m),E):n(m)}function d(m){return m===45?(e.consume(m),f):n(m)}function h(m){return m===null?n(m):m===45?(e.consume(m),p):V(m)?(l=h,le(m)):(e.consume(m),h)}function p(m){return m===45?(e.consume(m),f):h(m)}function f(m){return m===62?W(m):m===45?p(m):h(m)}function b(m){const me="CDATA[";return m===me.charCodeAt(a++)?(e.consume(m),a===me.length?j:b):n(m)}function j(m){return m===null?n(m):m===93?(e.consume(m),C):V(m)?(l=j,le(m)):(e.consume(m),j)}function C(m){return m===93?(e.consume(m),y):j(m)}function y(m){return m===62?W(m):m===93?(e.consume(m),y):j(m)}function E(m){return m===null||m===62?W(m):V(m)?(l=E,le(m)):(e.consume(m),E)}function v(m){return m===null?n(m):m===63?(e.consume(m),N):V(m)?(l=v,le(m)):(e.consume(m),v)}function N(m){return m===62?W(m):v(m)}function D(m){return Ue(m)?(e.consume(m),w):n(m)}function w(m){return m===45||Ie(m)?(e.consume(m),w):P(m)}function P(m){return V(m)?(l=P,le(m)):Z(m)?(e.consume(m),P):W(m)}function B(m){return m===45||Ie(m)?(e.consume(m),B):m===47||m===62||ke(m)?U(m):n(m)}function U(m){return m===47?(e.consume(m),W):m===58||m===95||Ue(m)?(e.consume(m),$):V(m)?(l=U,le(m)):Z(m)?(e.consume(m),U):W(m)}function $(m){return m===45||m===46||m===58||m===95||Ie(m)?(e.consume(m),$):z(m)}function z(m){return m===61?(e.consume(m),k):V(m)?(l=z,le(m)):Z(m)?(e.consume(m),z):U(m)}function k(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,F):V(m)?(l=k,le(m)):Z(m)?(e.consume(m),k):(e.consume(m),M)}function F(m){return m===i?(e.consume(m),i=void 0,_):m===null?n(m):V(m)?(l=F,le(m)):(e.consume(m),F)}function M(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||ke(m)?U(m):(e.consume(m),M)}function _(m){return m===47||m===62||ke(m)?U(m):n(m)}function W(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function le(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),A}function A(m){return Z(m)?ae(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):Y(m)}function Y(m){return e.enter("htmlTextData"),l(m)}}const Ns={name:"labelEnd",resolveAll:uf,resolveTo:df,tokenize:hf},lf={tokenize:ff},of={tokenize:pf},cf={tokenize:mf};function uf(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&$e(e,0,e.length,n),e}function df(e,t){let n=e.length,r=0,i,a,l,o;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=Pe(o,e.slice(a+1,a+r+3)),o=Pe(o,[["enter",d,t]]),o=Pe(o,ks(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),o=Pe(o,[["exit",d,t],e[l-2],e[l-1],["exit",u,t]]),o=Pe(o,e.slice(l+1)),o=Pe(o,[["exit",c,t]]),$e(e,a,e.length,o),e}function hf(e,t,n){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return o;function o(p){return a?a._inactive?h(p):(l=r.parser.defined.includes($t(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),c):n(p)}function c(p){return p===40?e.attempt(lf,d,l?d:h)(p):p===91?e.attempt(of,d,l?u:h)(p):l?d(p):h(p)}function u(p){return e.attempt(cf,d,h)(p)}function d(p){return t(p)}function h(p){return a._balanced=!0,n(p)}}function ff(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return ke(h)?vn(e,a)(h):a(h)}function a(h){return h===41?d(h):rl(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return ke(h)?vn(e,c)(h):d(h)}function o(h){return n(h)}function c(h){return h===34||h===39||h===40?il(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return ke(h)?vn(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function pf(e,t,n){const r=this;return i;function i(o){return sl.call(r,e,a,l,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes($t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function mf(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const xf={name:"labelStartImage",resolveAll:Ns.resolveAll,tokenize:gf};function gf(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),l):n(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const bf={name:"labelStartLink",resolveAll:Ns.resolveAll,tokenize:yf};function yf(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const br={name:"lineEnding",tokenize:vf};function vf(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ae(e,t,"linePrefix")}}const Hn={name:"thematicBreak",tokenize:jf};function jf(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||V(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Z(u)?ae(e,o,"whitespace")(u):o(u))}}const ve={continuation:{tokenize:Sf},exit:Ef,name:"list",tokenize:Nf},wf={partial:!0,tokenize:If},kf={partial:!0,tokenize:Cf};function Nf(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return o;function o(f){const b=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Wr(f)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Hn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return Wr(f)&&++l<10?(e.consume(f),c):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(ir,r.interrupt?n:d,e.attempt(wf,p,h))}function d(f){return r.containerState.initialBlankLine=!0,a++,p(f)}function h(f){return Z(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Sf(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ir,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ae(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!Z(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(kf,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ae(e,e.attempt(ve,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Cf(e,t,n){const r=this;return ae(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function Ef(e){e.exit(this.containerState.type)}function If(e,t,n){const r=this;return ae(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!Z(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Ni={name:"setextUnderline",resolveTo:_f,tokenize:Tf};function _f(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Tf(e,t,n){const r=this;let i;return a;function a(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Z(u)?ae(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||V(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const zf={tokenize:Pf};function Pf(e){const t=this,n=e.attempt(ir,r,e.attempt(this.parser.constructs.flowInitial,i,ae(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Mh,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Rf={resolveAll:ll()},Af=al("string"),Of=al("text");function al(e){return{resolveAll:ll(e==="text"?Mf:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,o);return l;function l(d){return u(d)?a(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const h=i[d];let p=-1;if(h)for(;++p<h.length;){const f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function ll(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function Mf(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,l=-1,o=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(u===-2)c=!0,o++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Lf={42:ve,43:ve,45:ve,48:ve,49:ve,50:ve,51:ve,52:ve,53:ve,54:ve,55:ve,56:ve,57:ve,62:Za},Df={91:Uh},Ff={[-2]:gr,[-1]:gr,32:gr},Bf={35:Kh,42:Hn,45:[Ni,Hn],60:Xh,61:Ni,95:Hn,96:wi,126:wi},Uf={38:tl,92:el},Hf={[-5]:br,[-4]:br,[-3]:br,33:xf,38:tl,42:Yr,60:[gh,sf],91:bf,92:[Vh,el],93:Ns,95:Yr,96:Th},qf={null:[Yr,Rf]},$f={null:[42,95]},Vf={null:[]},Qf=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$f,contentInitial:Df,disable:Vf,document:Lf,flow:Bf,flowInitial:Ff,insideSpan:qf,string:Uf,text:Hf},Symbol.toStringTag,{value:"Module"}));function Kf(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let l=[],o=[];const c={attempt:P(D),check:P(w),consume:E,enter:v,exit:N,interrupt:P(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:j,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:h};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function h(z){return l=Pe(l,z),C(),l[l.length-1]!==null?[]:(B(t,0),u.events=ks(a,u.events,u),u.events)}function p(z,k){return Wf(f(z),k)}function f(z){return Gf(l,z)}function b(){const{_bufferIndex:z,_index:k,line:F,column:M,offset:_}=r;return{_bufferIndex:z,_index:k,line:F,column:M,offset:_}}function j(z){i[z.line]=z.column,$()}function C(){let z;for(;r._index<l.length;){const k=l[r._index];if(typeof k=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<k.length;)y(k.charCodeAt(r._bufferIndex));else y(k)}}function y(z){d=d(z)}function E(z){V(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,$()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=z}function v(z,k){const F=k||{};return F.type=z,F.start=b(),u.events.push(["enter",F,u]),o.push(F),F}function N(z){const k=o.pop();return k.end=b(),u.events.push(["exit",k,u]),k}function D(z,k){B(z,k.from)}function w(z,k){k.restore()}function P(z,k){return F;function F(M,_,W){let le,A,Y,m;return Array.isArray(M)?Ve(M):"tokenize"in M?Ve([M]):me(M);function me(fe){return ln;function ln(et){const Lt=et!==null&&fe[et],Dt=et!==null&&fe.null,On=[...Array.isArray(Lt)?Lt:Lt?[Lt]:[],...Array.isArray(Dt)?Dt:Dt?[Dt]:[]];return Ve(On)(et)}}function Ve(fe){return le=fe,A=0,fe.length===0?W:x(fe[A])}function x(fe){return ln;function ln(et){return m=U(),Y=fe,fe.partial||(u.currentConstruct=fe),fe.name&&u.parser.constructs.disable.null.includes(fe.name)?yt():fe.tokenize.call(k?Object.assign(Object.create(u),k):u,c,Re,yt)(et)}}function Re(fe){return z(Y,m),_}function yt(fe){return m.restore(),++A<le.length?x(le[A]):W}}}function B(z,k){z.resolveAll&&!a.includes(z)&&a.push(z),z.resolve&&$e(u.events,k,u.events.length-k,z.resolve(u.events.slice(k),u)),z.resolveTo&&(u.events=z.resolveTo(u.events,u))}function U(){const z=b(),k=u.previous,F=u.currentConstruct,M=u.events.length,_=Array.from(o);return{from:M,restore:W};function W(){r=z,u.previous=k,u.currentConstruct=F,u.events.length=M,o=_,$()}}function $(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Gf(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function Wf(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
3
|
-
`;break}case-3:{l=`\r
|
|
4
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function Yf(e){const r={constructs:nh([Qf,...(e||{}).extensions||[]]),content:i(uh),defined:[],document:i(hh),flow:i(zf),lazy:{},string:i(Af),text:i(Of)};return r;function i(a){return l;function l(o){return Kf(r,a,o)}}}function Xf(e){for(;!nl(e););return e}const Si=/[\0\t\n\r]/g;function Jf(){let e=1,t="",n=!0,r;return i;function i(a,l,o){const c=[];let u,d,h,p,f;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(Si.lastIndex=h,u=Si.exec(a),p=u&&u.index!==void 0?u.index:a.length,f=a.charCodeAt(p),!u){t=a.slice(h);break}if(f===10&&h===p&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<p&&(c.push(a.slice(h,p)),e+=p-h),f){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Zf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ep(e){return e.replace(Zf,tp)}function tp(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return Ja(n.slice(a?2:1),a?16:10)}return ws(n)||e}const ol={}.hasOwnProperty;function np(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),rp(n)(Xf(Yf(n).document().write(Jf()(e,t,!0))))}function rp(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Rs),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Ts),blockQuote:a(Dt),characterEscape:U,characterReference:U,codeFenced:a(On),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(On,l),codeText:a(vl,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(jl),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(wl),hardBreakEscape:a(zs),hardBreakTrailing:a(zs),htmlFlow:a(Ps,l),htmlFlowData:U,htmlText:a(Ps,l),htmlTextData:U,image:a(kl),label:l,link:a(Rs),listItem:a(Nl),listItemValue:p,listOrdered:a(As,h),listUnordered:a(As),paragraph:a(Sl),reference:x,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ts),strong:a(Cl),thematicBreak:a(Il)},exit:{atxHeading:c(),atxHeadingSequence:D,autolink:c(),autolinkEmail:Lt,autolinkProtocol:et,blockQuote:c(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:yt,characterReferenceMarkerNumeric:yt,characterReferenceValue:fe,characterReference:ln,codeFenced:c(C),codeFencedFence:j,codeFencedFenceInfo:f,codeFencedFenceMeta:b,codeFlowValue:$,codeIndented:c(y),codeText:c(_),codeTextData:$,data:$,definition:c(),definitionDestinationString:N,definitionLabelString:E,definitionTitleString:v,emphasis:c(),hardBreakEscape:c(k),hardBreakTrailing:c(k),htmlFlow:c(F),htmlFlowData:$,htmlText:c(M),htmlTextData:$,image:c(le),label:Y,labelText:A,lineEnding:z,link:c(W),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Re,resourceDestinationString:m,resourceTitleString:me,resource:Ve,setextHeading:c(B),setextHeadingLineSequence:P,setextHeadingText:w,strong:c(),thematicBreak:c()}};cl(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(S){let T={type:"root",children:[]};const Q={stack:[T],tokenStack:[],config:t,enter:o,exit:u,buffer:l,resume:d,data:n},X=[];let te=-1;for(;++te<S.length;)if(S[te][1].type==="listOrdered"||S[te][1].type==="listUnordered")if(S[te][0]==="enter")X.push(te);else{const Ae=X.pop();te=i(S,Ae,te)}for(te=-1;++te<S.length;){const Ae=t[S[te][0]];ol.call(Ae,S[te][1].type)&&Ae[S[te][1].type].call(Object.assign({sliceSerialize:S[te][2].sliceSerialize},Q),S[te][1])}if(Q.tokenStack.length>0){const Ae=Q.tokenStack[Q.tokenStack.length-1];(Ae[1]||Ci).call(Q,void 0,Ae[0])}for(T.position={start:tt(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:tt(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},te=-1;++te<t.transforms.length;)T=t.transforms[te](T)||T;return T}function i(S,T,Q){let X=T-1,te=-1,Ae=!1,vt,Qe,on,cn;for(;++X<=Q;){const Se=S[X];switch(Se[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Se[0]==="enter"?te++:te--,cn=void 0;break}case"lineEndingBlank":{Se[0]==="enter"&&(vt&&!cn&&!te&&!on&&(on=X),cn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cn=void 0}if(!te&&Se[0]==="enter"&&Se[1].type==="listItemPrefix"||te===-1&&Se[0]==="exit"&&(Se[1].type==="listUnordered"||Se[1].type==="listOrdered")){if(vt){let Ft=X;for(Qe=void 0;Ft--;){const Ke=S[Ft];if(Ke[1].type==="lineEnding"||Ke[1].type==="lineEndingBlank"){if(Ke[0]==="exit")continue;Qe&&(S[Qe][1].type="lineEndingBlank",Ae=!0),Ke[1].type="lineEnding",Qe=Ft}else if(!(Ke[1].type==="linePrefix"||Ke[1].type==="blockQuotePrefix"||Ke[1].type==="blockQuotePrefixWhitespace"||Ke[1].type==="blockQuoteMarker"||Ke[1].type==="listItemIndent"))break}on&&(!Qe||on<Qe)&&(vt._spread=!0),vt.end=Object.assign({},Qe?S[Qe][1].start:Se[1].end),S.splice(Qe||X,0,["exit",vt,Se[2]]),X++,Q++}if(Se[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Se[1].start),end:void 0};vt=Ft,S.splice(X,0,["enter",Ft,Se[2]]),X++,Q++,on=void 0,cn=!0}}}return S[T][1]._spread=Ae,Q}function a(S,T){return Q;function Q(X){o.call(this,S(X),X),T&&T.call(this,X)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(S,T,Q){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([T,Q||void 0]),S.position={start:tt(T.start),end:void 0}}function c(S){return T;function T(Q){S&&S.call(this,Q),u.call(this,Q)}}function u(S,T){const Q=this.stack.pop(),X=this.tokenStack.pop();if(X)X[0].type!==S.type&&(T?T.call(this,S,X[0]):(X[1]||Ci).call(this,S,X[0]));else throw new Error("Cannot close `"+S.type+"` ("+yn({start:S.start,end:S.end})+"): it’s not open");Q.position.end=tt(S.end)}function d(){return eh(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(S){if(this.data.expectingFirstListItemValue){const T=this.stack[this.stack.length-2];T.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function f(){const S=this.resume(),T=this.stack[this.stack.length-1];T.lang=S}function b(){const S=this.resume(),T=this.stack[this.stack.length-1];T.meta=S}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S.replace(/(\r?\n|\r)$/g,"")}function E(S){const T=this.resume(),Q=this.stack[this.stack.length-1];Q.label=T,Q.identifier=$t(this.sliceSerialize(S)).toLowerCase()}function v(){const S=this.resume(),T=this.stack[this.stack.length-1];T.title=S}function N(){const S=this.resume(),T=this.stack[this.stack.length-1];T.url=S}function D(S){const T=this.stack[this.stack.length-1];if(!T.depth){const Q=this.sliceSerialize(S).length;T.depth=Q}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function P(S){const T=this.stack[this.stack.length-1];T.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function U(S){const Q=this.stack[this.stack.length-1].children;let X=Q[Q.length-1];(!X||X.type!=="text")&&(X=El(),X.position={start:tt(S.start),end:void 0},Q.push(X)),this.stack.push(X)}function $(S){const T=this.stack.pop();T.value+=this.sliceSerialize(S),T.position.end=tt(S.end)}function z(S){const T=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Q=T.children[T.children.length-1];Q.position.end=tt(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(T.type)&&(U.call(this,S),$.call(this,S))}function k(){this.data.atHardBreak=!0}function F(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S}function M(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S}function _(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S}function W(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=T,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function le(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=T,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function A(S){const T=this.sliceSerialize(S),Q=this.stack[this.stack.length-2];Q.label=ep(T),Q.identifier=$t(T).toLowerCase()}function Y(){const S=this.stack[this.stack.length-1],T=this.resume(),Q=this.stack[this.stack.length-1];if(this.data.inReference=!0,Q.type==="link"){const X=S.children;Q.children=X}else Q.alt=T}function m(){const S=this.resume(),T=this.stack[this.stack.length-1];T.url=S}function me(){const S=this.resume(),T=this.stack[this.stack.length-1];T.title=S}function Ve(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function Re(S){const T=this.resume(),Q=this.stack[this.stack.length-1];Q.label=T,Q.identifier=$t(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function yt(S){this.data.characterReferenceType=S.type}function fe(S){const T=this.sliceSerialize(S),Q=this.data.characterReferenceType;let X;Q?(X=Ja(T,Q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):X=ws(T);const te=this.stack[this.stack.length-1];te.value+=X}function ln(S){const T=this.stack.pop();T.position.end=tt(S.end)}function et(S){$.call(this,S);const T=this.stack[this.stack.length-1];T.url=this.sliceSerialize(S)}function Lt(S){$.call(this,S);const T=this.stack[this.stack.length-1];T.url="mailto:"+this.sliceSerialize(S)}function Dt(){return{type:"blockquote",children:[]}}function On(){return{type:"code",lang:null,meta:null,value:""}}function vl(){return{type:"inlineCode",value:""}}function jl(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wl(){return{type:"emphasis",children:[]}}function Ts(){return{type:"heading",depth:0,children:[]}}function zs(){return{type:"break"}}function Ps(){return{type:"html",value:""}}function kl(){return{type:"image",title:null,url:"",alt:null}}function Rs(){return{type:"link",title:null,url:"",children:[]}}function As(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function Nl(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function Sl(){return{type:"paragraph",children:[]}}function Cl(){return{type:"strong",children:[]}}function El(){return{type:"text",value:""}}function Il(){return{type:"thematicBreak"}}}function tt(e){return{line:e.line,column:e.column,offset:e.offset}}function cl(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?cl(e,r):sp(e,r)}}function sp(e,t){let n;for(n in t)if(ol.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ci(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yn({start:t.start,end:t.end})+") is still open")}function ip(e){const t=this;t.parser=n;function n(r){return np(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ap(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function lp(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
5
|
-
`}]}function op(e,t){const n=t.value?t.value+`
|
|
6
|
-
`:"",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=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function cp(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function up(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dp(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=an(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function hp(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fp(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ul(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function pp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ul(e,t);const i={src:an(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function mp(e,t){const n={src:an(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function xp(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function gp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ul(e,t);const i={href:an(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bp(e,t){const n={href:an(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yp(e,t,n){const r=e.all(t),i=n?vp(n):dl(t),a={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.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;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
7
|
-
`}),d.type==="element"&&d.tagName==="p"&&!i?l.push(...d.children):l.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&l.push({type:"text",value:`
|
|
8
|
-
`});const u={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,u),e.applyData(t,u)}function vp(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=dl(n[r])}return t}function dl(e){const t=e.spread;return t??e.children.length>1}function jp(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function wp(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kp(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Np(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sp(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=bs(t.children[1]),c=Va(t.children[t.children.length-1]);o&&c&&(l.position={start:o,end:c}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Cp(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const h=t.children[c],p={},f=l?l[c]:void 0;f&&(p.align=f);let b={type:"element",tagName:a,properties:p,children:[]};h&&(b.children=e.all(h),e.patch(h,b),b=e.applyData(h,b)),u.push(b)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function Ep(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ei=9,Ii=32;function Ip(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(_i(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(_i(t.slice(i),i>0,!1)),a.join("")}function _i(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Ei||a===Ii;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Ei||a===Ii;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _p(e,t){const n={type:"text",value:Ip(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Tp(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zp={blockquote:ap,break:lp,code:op,delete:cp,emphasis:up,footnoteReference:dp,heading:hp,html:fp,imageReference:pp,image:mp,inlineCode:xp,linkReference:gp,link:bp,listItem:yp,list:jp,paragraph:wp,root:kp,strong:Np,table:Sp,tableCell:Ep,tableRow:Cp,text:_p,thematicBreak:Tp,toml:Fn,yaml:Fn,definition:Fn,footnoteDefinition:Fn};function Fn(){}const hl=-1,ar=0,jn=1,Qn=2,Ss=3,Cs=4,Es=5,Is=6,fl=7,pl=8,Ti=typeof self=="object"?self:globalThis,Pp=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case ar:case hl:return n(l,i);case jn:{const o=n([],i);for(const c of l)o.push(r(c));return o}case Qn:{const o=n({},i);for(const[c,u]of l)o[r(c)]=r(u);return o}case Ss:return n(new Date(l),i);case Cs:{const{source:o,flags:c}=l;return n(new RegExp(o,c),i)}case Es:{const o=n(new Map,i);for(const[c,u]of l)o.set(r(c),r(u));return o}case Is:{const o=n(new Set,i);for(const c of l)o.add(r(c));return o}case fl:{const{name:o,message:c}=l;return n(new Ti[o](c),i)}case pl:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}}return n(new Ti[a](l),i)};return r},zi=e=>Pp(new Map,e)(0),Ut="",{toString:Rp}={},{keys:Ap}=Object,pn=e=>{const t=typeof e;if(t!=="object"||!e)return[ar,t];const n=Rp.call(e).slice(8,-1);switch(n){case"Array":return[jn,Ut];case"Object":return[Qn,Ut];case"Date":return[Ss,Ut];case"RegExp":return[Cs,Ut];case"Map":return[Es,Ut];case"Set":return[Is,Ut];case"DataView":return[jn,n]}return n.includes("Array")?[jn,n]:n.includes("Error")?[fl,n]:[Qn,n]},Bn=([e,t])=>e===ar&&(t==="function"||t==="symbol"),Op=(e,t,n,r)=>{const i=(l,o)=>{const c=r.push(l)-1;return n.set(o,c),c},a=l=>{if(n.has(l))return n.get(l);let[o,c]=pn(l);switch(o){case ar:{let d=l;switch(c){case"bigint":o=pl,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([hl],l)}return i([o,d],l)}case jn:{if(c){let p=l;return c==="DataView"?p=new Uint8Array(l.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(l)),i([c,[...p]],l)}const d=[],h=i([o,d],l);for(const p of l)d.push(a(p));return h}case Qn:{if(c)switch(c){case"BigInt":return i([c,l.toString()],l);case"Boolean":case"Number":case"String":return i([c,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const d=[],h=i([o,d],l);for(const p of Ap(l))(e||!Bn(pn(l[p])))&&d.push([a(p),a(l[p])]);return h}case Ss:return i([o,l.toISOString()],l);case Cs:{const{source:d,flags:h}=l;return i([o,{source:d,flags:h}],l)}case Es:{const d=[],h=i([o,d],l);for(const[p,f]of l)(e||!(Bn(pn(p))||Bn(pn(f))))&&d.push([a(p),a(f)]);return h}case Is:{const d=[],h=i([o,d],l);for(const p of l)(e||!Bn(pn(p)))&&d.push(a(p));return h}}const{message:u}=l;return i([o,{name:c,message:u}],l)};return a},Pi=(e,{json:t,lossy:n}={})=>{const r=[];return Op(!(t||n),!!t,new Map,r)(e),r},Kn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?zi(Pi(e,t)):structuredClone(e):(e,t)=>zi(Pi(e,t));function Mp(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Lp(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Dp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Mp,r=e.options.footnoteBackLabel||Lp,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),p=an(h.toLowerCase());let f=0;const b=[],j=e.footnoteCounts.get(h);for(;j!==void 0&&++f<=j;){b.length>0&&b.push({type:"text",value:" "});let E=typeof n=="string"?n:n(c,f);typeof E=="string"&&(E={type:"text",value:E}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const C=d[d.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const E=C.children[C.children.length-1];E&&E.type==="text"?E.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...b)}else d.push(...b);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Kn(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
9
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
10
|
-
`}]}}const ml=(function(e){if(e==null)return Hp;if(typeof e=="function")return lr(e);if(typeof e=="object")return Array.isArray(e)?Fp(e):Bp(e);if(typeof e=="string")return Up(e);throw new Error("Expected function, string, or object as test")});function Fp(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ml(e[n]);return lr(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Bp(e){const t=e;return lr(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Up(e){return lr(t);function t(n){return n&&n.type===e}}function lr(e){return t;function t(n,r,i){return!!(qp(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Hp(){return!0}function qp(e){return e!==null&&typeof e=="object"&&"type"in e}const xl=[],$p=!0,Ri=!1,Vp="skip";function Qp(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=ml(i),l=r?-1:1;o(e,void 0,[])();function o(c,u,d){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=xl,b,j,C;if((!t||a(c,u,d[d.length-1]||void 0))&&(f=Kp(n(c,d)),f[0]===Ri))return f;if("children"in c&&c.children){const y=c;if(y.children&&f[0]!==Vp)for(j=(r?y.children.length:-1)+l,C=d.concat(y);j>-1&&j<y.children.length;){const E=y.children[j];if(b=o(E,j,C)(),b[0]===Ri)return b;j=typeof b[1]=="number"?b[1]:j+l}}return f}}}function Kp(e){return Array.isArray(e)?e:typeof e=="number"?[$p,e]:e==null?xl:[e]}function gl(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),Qp(e,a,o,i);function o(c,u){const d=u[u.length-1],h=d?d.children.indexOf(c):void 0;return l(c,h,d)}}const Xr={}.hasOwnProperty,Gp={};function Wp(e,t){const n=t||Gp,r=new Map,i=new Map,a=new Map,l={...zp,...n.handlers},o={all:u,applyData:Xp,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:c,options:n,patch:Yp,wrap:Zp};return gl(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,p=String(d.identifier).toUpperCase();h.has(p)||h.set(p,d)}}),o;function c(d,h){const p=d.type,f=o.handlers[p];if(Xr.call(o.handlers,p)&&f)return f(o,d,h);if(o.options.passThrough&&o.options.passThrough.includes(p)){if("children"in d){const{children:j,...C}=d,y=Kn(C);return y.children=o.all(d),y}return Kn(d)}return(o.options.unknownHandler||Jp)(o,d,h)}function u(d){const h=[];if("children"in d){const p=d.children;let f=-1;for(;++f<p.length;){const b=o.one(p[f],d);if(b){if(f&&p[f-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=Ai(b.value)),!Array.isArray(b)&&b.type==="element")){const j=b.children[0];j&&j.type==="text"&&(j.value=Ai(j.value))}Array.isArray(b)?h.push(...b):h.push(b)}}}return h}}function Yp(e,t){e.position&&(t.position=Pd(e))}function Xp(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Kn(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Jp(e,t){const n=t.data||{},r="value"in t&&!(Xr.call(n,"hProperties")||Xr.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)}function Zp(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
11
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
12
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
13
|
-
`}),n}function Ai(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Oi(e,t){const n=Wp(e,t),r=n.one(e,void 0),i=Dp(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
14
|
-
`},i),a}function em(e,t){return e&&"run"in e?async function(n,r){const i=Oi(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Oi(n,{file:r,...e||t})}}function Mi(e){if(e)throw e}var yr,Li;function tm(){if(Li)return yr;Li=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},a=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!h)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},l=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},o=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return yr=function c(){var u,d,h,p,f,b,j=arguments[0],C=1,y=arguments.length,E=!1;for(typeof j=="boolean"&&(E=j,j=arguments[1]||{},C=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});C<y;++C)if(u=arguments[C],u!=null)for(d in u)h=o(j,d),p=o(u,d),j!==p&&(E&&p&&(a(p)||(f=i(p)))?(f?(f=!1,b=h&&i(h)?h:[]):b=h&&a(h)?h:{},l(j,{name:d,newValue:c(E,b,p)})):typeof p<"u"&&l(j,{name:d,newValue:p}));return j},yr}var nm=tm();const vr=na(nm);function Jr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rm(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...i);function o(c,...u){const d=e[++a];let h=-1;if(c){l(c);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,d?sm(d,o)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function sm(e,t){let n;return r;function r(...l){const o=e.length>l.length;let c;o&&l.push(i);try{c=e.apply(this,l)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(l,...o){n||(n=!0,t(l,...o))}function a(l){i(null,l)}}const Le={basename:im,dirname:am,extname:lm,join:om,sep:"/"};function im(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');An(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function am(e){if(An(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function lm(e){An(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function om(...e){let t=-1,n;for(;++t<e.length;)An(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cm(n)}function cm(e){An(e);const t=e.codePointAt(0)===47;let n=um(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function um(e,t){let n="",r=0,i=-1,a=0,l=-1,o,c;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else o===46&&a>-1?a++:a=-1}return n}function An(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dm={cwd:hm};function hm(){return"/"}function Zr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fm(e){if(typeof e=="string")e=new URL(e);else if(!Zr(e)){const t=new 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(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return pm(e)}function pm(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const jr=["history","path","basename","stem","extname","dirname"];class bl{constructor(t){let n;t?Zr(t)?n={path:t}:typeof t=="string"||mm(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dm.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<jr.length;){const a=jr[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)jr.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Le.basename(this.path):void 0}set basename(t){kr(t,"basename"),wr(t,"basename"),this.path=Le.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Le.dirname(this.path):void 0}set dirname(t){Di(this.basename,"dirname"),this.path=Le.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Le.extname(this.path):void 0}set extname(t){if(wr(t,"extname"),Di(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Le.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zr(t)&&(t=fm(t)),kr(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Le.basename(this.path,this.extname):void 0}set stem(t){kr(t,"stem"),wr(t,"stem"),this.path=Le.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ge(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function wr(e,t){if(e&&e.includes(Le.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Le.sep+"`")}function kr(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Di(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function mm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xm=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),gm={}.hasOwnProperty;class _s extends xm{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=rm()}copy(){const t=new _s;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(vr(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Cr("data",this.frozen),this.namespace[t]=n,this):gm.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Cr("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Un(t),r=this.parser||this.Parser;return Nr("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Nr("process",this.parser||this.Parser),Sr("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const o=Un(t),c=r.parse(o);r.run(c,o,function(d,h,p){if(d||!h||!p)return u(d);const f=h,b=r.stringify(f,p);vm(b)?p.value=b:p.result=b,u(d,p)});function u(d,h){d||!h?l(d):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Nr("processSync",this.parser||this.Parser),Sr("processSync",this.compiler||this.Compiler),this.process(t,i),Bi("processSync","process",n),r;function i(a,l){n=!0,Mi(a),r=l}}run(t,n,r){Fi(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,o){const c=Un(n);i.run(t,c,u);function u(d,h,p){const f=h||t;d?o(d):l?l(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Bi("runSync","run",r),i;function a(l,o){Mi(l),i=o,r=!0}}stringify(t,n){this.freeze();const r=Un(n),i=this.compiler||this.Compiler;return Sr("stringify",i),Fi(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Cr("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;c(d,h)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))throw new 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");o(u.plugins),u.settings&&(i.settings=vr(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];a(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[f,...b]=d;const j=r[p][1];Jr(j)&&Jr(f)&&(f=vr(!0,j,f)),r[p]=[u,f,...b]}}}}const bm=new _s().freeze();function Nr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Sr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Cr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Fi(e){if(!Jr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Bi(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Un(e){return ym(e)?e:new bl(e)}function ym(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vm(e){return typeof e=="string"||jm(e)}function jm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wm="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ui=[],Hi={allowDangerousHtml:!0},km=/^(https?|ircs?|mailto|xmpp)$/i,Nm=[{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 Sm(e){const t=Cm(e),n=Em(e);return Im(t.runSync(t.parse(n),n),e)}function Cm(e){const t=e.rehypePlugins||Ui,n=e.remarkPlugins||Ui,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hi}:Hi;return bm().use(ip).use(n).use(em,r).use(t)}function Em(e){const t=e.children||"",n=new bl;return typeof t=="string"&&(n.value=t),n}function Im(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||_m;for(const d of Nm)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+wm+d.id,void 0);return gl(e,u),Ld(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(d,h,p){if(d.type==="raw"&&p&&typeof h=="number")return l?p.children.splice(h,1):p.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let f;for(f in xr)if(Object.hasOwn(xr,f)&&Object.hasOwn(d.properties,f)){const b=d.properties[f],j=xr[f];(j===null||j.includes(d.tagName))&&(d.properties[f]=c(String(b||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(d,h,p)),f&&p&&typeof h=="number")return o&&d.children?p.children.splice(h,1,...d.children):p.children.splice(h,1),h}}}function _m(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||km.test(e.slice(0,t))?e:""}const Tm={created:s.jsx(gt,{className:"size-3.5"}),validated:s.jsx(is,{className:"size-3.5"}),deployed:s.jsx(qn,{className:"size-3.5"}),rejected:s.jsx(Me,{className:"size-3.5"}),rolled_back:s.jsx(la,{className:"size-3.5"})},zm={created:"outline",validated:"secondary",deployed:"default",rejected:"destructive",rolled_back:"destructive"};function Pm(e){const t=e.split(`
|
|
15
|
-
`);if(t.length<3||t[0].trim()!=="---")return{meta:{},body:e};let n=-1;for(let i=1;i<t.length;i++)if(t[i].trim()==="---"){n=i;break}if(n===-1)return{meta:{},body:e};const r={};for(const i of t.slice(1,n)){const a=i.indexOf(":");if(a>0){const l=i.slice(0,a).trim(),o=i.slice(a+1).trim();l&&o&&(r[l]=o)}}return{meta:r,body:t.slice(n+1).join(`
|
|
16
|
-
`)}}function Rm({meta:e}){const t=Object.entries(e);return t.length===0?null:s.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:t.map(([n,r])=>s.jsxs("div",{className:"contents",children:[s.jsx("span",{className:"font-medium text-muted-foreground capitalize",children:n}),s.jsx("span",{className:"text-foreground truncate",children:r})]},n))})}function qi({label:e,text:t,variant:n}){const{meta:r,body:i}=Pm(t),a=Object.keys(r).length>0;return s.jsxs("div",{className:"flex-1 min-w-0 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mn,{className:"size-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),n==="proposed"&&s.jsx(H,{variant:"secondary",className:"text-[10px]",children:"New"})]}),a&&s.jsx("div",{className:"rounded-md border bg-muted/30 p-3",children:s.jsx(Rm,{meta:r})}),s.jsx("div",{className:"skill-markdown rounded-md border bg-card p-4",children:s.jsx(Sm,{children:i})})]})}function Am(e,t){if(typeof t=="boolean")return t?s.jsx(Je,{className:"size-3.5 text-emerald-500 inline"}):s.jsx(Me,{className:"size-3.5 text-red-500 inline"});if(typeof t=="number"){if(e.includes("rate")||e.includes("change")||t>=-1&&t<=1&&e!=="count"){const r=(t*100).toFixed(1),i=t>0&&e.includes("change")?"+":"";return s.jsxs("span",{className:"font-mono",children:[i,r,"%"]})}return s.jsx("span",{className:"font-mono",children:t})}return t==null?s.jsx("span",{className:"text-muted-foreground",children:"--"}):typeof t=="string"?s.jsx("span",{children:t}):Array.isArray(t)?t.length===0?s.jsx("span",{className:"text-muted-foreground italic",children:"none"}):s.jsxs("span",{className:"font-mono",children:[t.length," entries"]}):typeof t=="object"?s.jsx("span",{className:"font-mono",children:"1 entry"}):s.jsx("span",{children:String(t)})}function es({entry:e}){const t=e.entry,n=(t==null?void 0:t.query)??e.query??e.prompt??e.input??e.text,r=(t==null?void 0:t.should_trigger)??e.should_trigger,i=(t==null?void 0:t.invocation_type)??e.invocation_type,a=e.before_pass??e.before??e.original_triggered??e.baseline,l=e.after_pass??e.after??e.triggered??e.result,o=e.passed??e.matched,c=typeof l=="boolean"?l:typeof o=="boolean"?o:null;return s.jsxs("div",{className:"flex items-start gap-2 text-xs py-1.5 border-b border-border/50 last:border-0",children:[c!==null?c?s.jsx(Je,{className:"size-3.5 text-emerald-500 shrink-0 mt-0.5"}):s.jsx(Me,{className:"size-3.5 text-red-500 shrink-0 mt-0.5"}):s.jsx(gt,{className:"size-3.5 text-muted-foreground shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 min-w-0 line-clamp-2",children:n?String(n):JSON.stringify(e)}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[typeof a=="boolean"&&typeof l=="boolean"&&s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[a?"pass":"fail"," → ",l?"pass":"fail"]}),r!==void 0&&s.jsxs(H,{variant:"secondary",className:"text-[9px]",children:["expect: ",String(r)]}),i!=null&&s.jsx(H,{variant:"secondary",className:"text-[9px]",children:String(i)})]})]})}function Om({validation:e}){const{improved:t,before_pass_rate:n,after_pass_rate:r,net_change:i,regressions:a,new_passes:l,per_entry_results:o,...c}=e,u=Array.isArray(a)?a:[],d=Array.isArray(l)?l:[],h=Array.isArray(o)?o:[];return s.jsxs("div",{className:"rounded-md border bg-muted/30 p-3 space-y-3",children:[s.jsxs("p",{className:"text-xs font-medium text-muted-foreground",children:["Validation Results",s.jsx("span",{className:"font-normal text-muted-foreground/60 ml-1.5",children:"— Before/after comparison from eval tests"})]}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t!==void 0&&s.jsx(H,{variant:t?"default":"destructive",className:"text-[10px]",children:t?"Improved":"Regressed"}),typeof n=="number"&&typeof r=="number"&&s.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:[(n*100).toFixed(1),"% → ",(r*100).toFixed(1),"%"]}),typeof i=="number"&&s.jsxs("span",{className:`text-xs font-mono font-semibold ${i>0?"text-emerald-600 dark:text-emerald-400":"text-red-500"}`,children:[i>0?"+":"",(i*100).toFixed(1),"%"]})]}),d.length>0&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[11px] font-medium text-emerald-600 dark:text-emerald-400 mb-1",children:["New Passes (",d.length,")"]}),s.jsx("div",{className:"rounded border bg-card p-2",children:d.map((p,f)=>s.jsx(es,{entry:typeof p=="object"&&p!==null?p:{value:p}},f))})]}),u.length>0&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[11px] font-medium text-red-500 mb-1",children:["Regressions (",u.length,")"]}),s.jsx("div",{className:"rounded border border-red-200 dark:border-red-900/50 bg-card p-2",children:u.map((p,f)=>s.jsx(es,{entry:typeof p=="object"&&p!==null?p:{value:p}},f))})]}),h.length>0&&s.jsx(Mm,{entries:h}),Object.keys(c).length>0&&s.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:Object.entries(c).map(([p,f])=>s.jsxs("div",{className:"contents",children:[s.jsx("span",{className:"font-mono text-muted-foreground",children:p}),s.jsx("span",{className:"text-foreground",children:Am(p,f)})]},p))})]})}function Mm({entries:e}){const[t,n]=O.useState(!1),r=e.filter(a=>{if(typeof a!="object"||a===null)return!1;const l=a;return l.passed===!0||l.matched===!0||l.triggered===!0||l.after===!0||l.result===!0}).length,i=t?e:e.slice(0,5);return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsxs("p",{className:"text-[11px] font-medium text-muted-foreground",children:["Individual Test Cases (",r,"/",e.length," passed)"]}),e.length>5&&s.jsx("button",{type:"button",onClick:()=>n(!t),className:"text-[10px] text-primary hover:underline",children:t?"Show less":`Show all ${e.length}`})]}),s.jsx("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden mb-2",children:s.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${e.length>0?r/e.length*100:0}%`}})}),s.jsx("div",{className:"rounded border bg-card p-2 max-h-[300px] overflow-y-auto",children:i.map((a,l)=>s.jsx(es,{entry:typeof a=="object"&&a!==null?a:{value:a}},l))})]})}function ts(e){if(!e.validation)return null;const t=e.validation.after_pass_rate;return typeof t=="number"?t:null}function Lm({prev:e,curr:t}){if(e===null||t===null)return null;const n=t-e;if(n===0)return null;const r=(n*100).toFixed(1),i=n>0;return s.jsxs("span",{className:`text-[10px] font-mono font-semibold ${i?"text-emerald-600 dark:text-emerald-400":"text-red-500"}`,children:[i?"+":"",r,"% vs previous"]})}function Dm({evalSet:e}){const[t,n]=O.useState(!1),r=e.filter(i=>(i.passed??i.result)===!0).length;return s.jsxs("div",{className:"rounded-md border bg-muted/30 p-3 space-y-2",children:[s.jsxs("button",{type:"button",onClick:()=>n(!t),className:"flex items-center gap-1.5 w-full text-left",children:[t?s.jsx(At,{className:"size-3.5 text-muted-foreground shrink-0"}):s.jsx(Ot,{className:"size-3.5 text-muted-foreground shrink-0"}),s.jsx(Vo,{className:"size-3.5 text-muted-foreground"}),s.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:["Eval Set (",r,"/",e.length," passed)"]})]}),t&&s.jsx("div",{className:"space-y-1",children:e.map((i,a)=>{const l=i.query??i.prompt??i.input,o=i.expected??i.should_trigger,c=i.passed??i.result;return s.jsxs("div",{className:"flex items-start gap-2 text-xs py-1 border-b border-border/50 last:border-0",children:[typeof c=="boolean"?c?s.jsx(Je,{className:"size-3.5 text-emerald-500 shrink-0 mt-0.5"}):s.jsx(Me,{className:"size-3.5 text-red-500 shrink-0 mt-0.5"}):s.jsx(gt,{className:"size-3.5 text-muted-foreground shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 min-w-0 line-clamp-2",children:String(l??JSON.stringify(i))}),o!==void 0&&s.jsxs(H,{variant:"secondary",className:"text-[9px] shrink-0",children:["expect: ",String(o)]})]},a)})})]})}function Er({entry:e,roundLabel:t,roundStatus:n,prevPassRate:r,currPassRate:i}){const a=n!=="single";return s.jsxs(ne,{className:n==="final"?"border-primary/50 shadow-sm":void 0,children:[s.jsx(se,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(ie,{className:"text-sm flex items-center gap-2",children:[s.jsx(oa,{className:"size-4 text-muted-foreground"}),"Evidence: ",e.target,a&&t&&s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:t}),n==="final"&&s.jsx(H,{variant:"default",className:"text-[10px]",children:"Final"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[a&&s.jsx(Lm,{prev:r,curr:i}),s.jsx(H,{variant:"secondary",className:"text-[10px]",children:e.stage}),e.confidence!==null&&s.jsxs(H,{variant:e.confidence>=.8?"default":e.confidence>=.5?"secondary":"destructive",className:"text-[10px] font-mono",children:[dt(e.confidence)," confidence"]}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:_e(e.timestamp)})]})]})}),s.jsxs(Ze,{className:"space-y-4",children:[e.rationale&&s.jsxs("div",{className:"rounded-md border-l-2 border-primary/40 bg-primary/5 px-3 py-2",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Rationale"}),s.jsx("p",{className:"text-sm leading-relaxed",children:e.rationale})]}),e.details&&s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e.details}),(e.original_text||e.proposed_text)&&s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[e.original_text&&s.jsx(qi,{label:"Original",text:e.original_text,variant:"original"}),e.proposed_text&&s.jsx(qi,{label:"Proposed",text:e.proposed_text,variant:"proposed"})]}),e.eval_set&&e.eval_set.length>0&&s.jsx(Dm,{evalSet:e.eval_set}),e.validation&&Object.keys(e.validation).length>0&&s.jsx(Om,{validation:e.validation})]})]})}function Fm({entry:e,roundLabel:t,onExpand:n}){var a;const r=ts(e),i=(a=e.validation)==null?void 0:a.improved;return s.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-3 w-full rounded-lg border border-dashed px-4 py-3 text-left hover:bg-accent/50 transition-colors",children:[s.jsx(Ot,{className:"size-4 text-muted-foreground shrink-0"}),s.jsx(oa,{className:"size-3.5 text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e.target}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:t}),s.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[r!==null&&s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:[(r*100).toFixed(1),"% pass rate"]}),typeof i=="boolean"&&s.jsx(H,{variant:i?"default":"destructive",className:"text-[9px]",children:i?"Improved":"Regressed"}),s.jsx(H,{variant:"secondary",className:"text-[10px]",children:e.stage}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:_e(e.timestamp)})]})]})}function Bm({proposalId:e,evolution:t,evidence:n}){const r=O.useMemo(()=>t.filter(h=>h.proposal_id===e).sort((h,p)=>new Date(h.timestamp).getTime()-new Date(p.timestamp).getTime()),[t,e]),i=O.useMemo(()=>n.filter(h=>h.proposal_id===e).sort((h,p)=>new Date(h.timestamp).getTime()-new Date(p.timestamp).getTime()),[n,e]),[a,l]=O.useState(new Set),o=h=>{l(p=>{const f=new Set(p);return f.has(h)?f.delete(h):f.add(h),f})},c=O.useMemo(()=>{for(let h=r.length-1;h>=0;h--)if(r[h].eval_snapshot)return r[h].eval_snapshot;return null},[r]),{proposalEntries:u,validationsByTarget:d}=O.useMemo(()=>{const h=[],p=new Map;for(const f of i)if(f.stage!=="validated")h.push(f);else{const b=f.target;p.has(b)||p.set(b,[]),p.get(b).push(f)}return{proposalEntries:h,validationsByTarget:p}},[i]);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-primary/20 bg-primary/5 px-3.5 py-2.5",children:[s.jsx(aa,{className:"size-4 text-primary/60 shrink-0 mt-0.5"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"This view shows the complete evidence trail for a skill evolution proposal — how the skill was changed, the eval test results before and after, and whether the change improved performance."})]}),s.jsxs(ne,{children:[s.jsx(se,{className:"pb-3",children:s.jsxs(ie,{className:"text-sm flex items-center gap-2",children:[s.jsx("span",{children:"Proposal Journey"}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["#",e.slice(0,12)]})]})}),s.jsxs(Ze,{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:r.map((h,p)=>s.jsxs("div",{className:"contents",children:[p>0&&s.jsx($o,{className:"size-3 text-muted-foreground/50 shrink-0"}),s.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 bg-card",children:[Tm[h.action],s.jsx(H,{variant:zm[h.action]??"secondary",className:"text-[10px] capitalize",children:h.action.replace("_"," ")}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:_e(h.timestamp)})]})]},`${h.action}-${p}`))}),c&&s.jsxs("div",{className:"flex items-center gap-3 rounded-md border bg-muted/20 px-3 py-2",children:[typeof c.net_change=="number"&&s.jsxs("div",{className:"flex items-center gap-1",children:[c.net_change>0?s.jsx(Zn,{className:"size-3.5 text-emerald-500"}):s.jsx(er,{className:"size-3.5 text-red-500"}),s.jsxs("span",{className:`text-sm font-semibold font-mono ${c.net_change>0?"text-emerald-600 dark:text-emerald-400":"text-red-500"}`,children:[c.net_change>0?"+":"",Math.round(c.net_change*100),"%"]})]}),typeof c.before_pass_rate=="number"&&typeof c.after_pass_rate=="number"&&s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c.before_pass_rate*100),"% →"," ",Math.round(c.after_pass_rate*100),"%"]}),c.improved!==void 0&&s.jsx(H,{variant:c.improved?"default":"destructive",className:"text-[10px]",children:c.improved?"Improved":"Regressed"})]}),r.length>0&&r[r.length-1].details&&s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r[r.length-1].details})]})]}),u.map(h=>s.jsx(Er,{entry:h,roundLabel:null,roundStatus:"single",prevPassRate:null,currPassRate:null},`proposal-${h.target}-${h.timestamp}`)),Array.from(d.entries()).map(([h,p])=>{const f=p.length>1;return s.jsx("div",{className:"space-y-2",children:p.map((b,j)=>{const C=j===p.length-1,y=f?`Round ${j+1} of ${p.length}`:null,E=j>0?ts(p[j-1]):null,v=ts(b),N=`${h}-${b.timestamp}`,D=f?C?"final":"intermediate":"single";return D==="intermediate"&&!a.has(N)?s.jsx(Fm,{entry:b,roundLabel:y,onExpand:()=>o(N)},N):D==="intermediate"&&a.has(N)?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("button",{type:"button",onClick:()=>o(N),className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors px-1",children:[s.jsx(At,{className:"size-3"}),"Collapse ",y]}),s.jsx(Er,{entry:b,roundLabel:y,roundStatus:D,prevPassRate:E,currPassRate:v})]},N):s.jsx(Er,{entry:b,roundLabel:y,roundStatus:D,prevPassRate:E,currPassRate:v},N)})},h)}),i.length===0&&s.jsx("div",{className:"flex items-center justify-center rounded-lg border border-dashed py-8",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No evidence entries for this proposal"})})]})}const Um={created:s.jsx(gt,{className:"size-3.5"}),validated:s.jsx(is,{className:"size-3.5"}),deployed:s.jsx(qn,{className:"size-3.5"}),rejected:s.jsx(Me,{className:"size-3.5"}),rolled_back:s.jsx(la,{className:"size-3.5"})},ns={created:"bg-blue-500",validated:"bg-amber-500",deployed:"bg-emerald-500",rejected:"bg-red-500",rolled_back:"bg-red-400"},Hm={created:"ring-blue-500/30",validated:"ring-amber-500/30",deployed:"ring-emerald-500/30",rejected:"ring-red-500/30",rolled_back:"ring-red-400/30"},qm={created:"bg-blue-500/30",validated:"bg-amber-500/30",deployed:"bg-emerald-500/30",rejected:"bg-red-500/30",rolled_back:"bg-red-400/30"};function $m(e){const t=new Map;for(const n of e){const r=t.get(n.proposal_id)??[];r.push(n),t.set(n.proposal_id,r)}for(const n of t.values())n.sort((r,i)=>new Date(r.timestamp).getTime()-new Date(i.timestamp).getTime());return Array.from(t.entries()).sort((n,r)=>{const i=n[1][n[1].length-1],a=r[1][r[1].length-1];return new Date(a.timestamp).getTime()-new Date(i.timestamp).getTime()})}function Vm(e){return e[e.length-1].action}function Qm(e){for(let t=e.length-1;t>=0;t--)if(e[t].eval_snapshot)return e[t].eval_snapshot;return null}function Km({snapshot:e}){const t=e.net_change;if(t==null)return null;const n=Math.round(t*100),r=n>0;return s.jsxs("span",{className:L("inline-flex items-center gap-0.5 text-[10px] font-mono font-medium",r?"text-emerald-600 dark:text-emerald-400":"text-red-500"),children:[r?s.jsx(Zn,{className:"size-2.5"}):s.jsx(er,{className:"size-2.5"}),r?"+":"",n,"%"]})}const Gm=[{action:"created",label:"Created",desc:"Proposal generated from session data"},{action:"validated",label:"Validated",desc:"Eval tests run, awaiting deployment"},{action:"deployed",label:"Deployed",desc:"Accepted and applied to skill file"},{action:"rejected",label:"Rejected",desc:"Failed validation criteria"},{action:"rolled_back",label:"Rolled Back",desc:"Reverted after deployment"}];function Wm(){const[e,t]=O.useState(!1);return s.jsxs("div",{className:"px-2 pb-2",children:[s.jsxs("button",{type:"button",onClick:()=>t(!e),className:"flex items-center gap-1 text-[10px] text-muted-foreground/70 hover:text-muted-foreground transition-colors w-full",children:[e?s.jsx(At,{className:"size-3"}):s.jsx(Ot,{className:"size-3"}),"Lifecycle stages"]}),e&&s.jsx("div",{className:"mt-1.5 space-y-1.5 rounded-md border bg-muted/30 p-2",children:Gm.map(n=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:L("size-2 rounded-full mt-1 shrink-0",ns[n.action])}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"text-[10px] font-medium",children:n.label}),s.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:n.desc})]})]},n.action))})]})}function Ym({entries:e,selectedProposalId:t,onSelect:n}){const r=$m(e);return r.length===0?s.jsx("div",{className:"flex items-center justify-center rounded-lg border border-dashed py-6 px-3",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"No evolution history yet"})}):s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider px-2 pb-2 sticky top-0 z-10 bg-background",children:"Evolution"}),s.jsx(Wm,{}),s.jsx("nav",{className:"flex flex-col",children:r.map(([i,a],l)=>{const o=Vm(a),c=t===i,u=a[a.length-1],d=ns[o]??"bg-muted-foreground",h=Hm[o]??"ring-muted-foreground/30",p=qm[o]??"bg-border",f=l===r.length-1,b=Qm(a);return s.jsxs("div",{className:"relative flex gap-3",children:[s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("div",{className:L("flex items-center justify-center size-7 rounded-full ring-2 text-white shrink-0 z-10",d,h),children:Um[o]??s.jsx(gt,{className:"size-3.5"})}),!f&&s.jsx("div",{className:L("w-0.5 flex-1 min-h-[16px]",p)})]}),s.jsxs("button",{type:"button",onClick:()=>n(i),className:L("flex-1 min-w-0 rounded-md px-2.5 py-2 text-left transition-all mb-1","hover:bg-accent/50",c?"bg-primary/5 ring-1 ring-primary/20":""),children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(H,{variant:o==="deployed"?"default":o==="rejected"||o==="rolled_back"?"destructive":"secondary",className:"text-[10px] capitalize",children:o.replace("_"," ")}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:_e(u.timestamp)})]}),b&&s.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[s.jsx(Km,{snapshot:b}),b.before_pass_rate!==void 0&&b.after_pass_rate!==void 0&&s.jsxs("span",{className:"text-[10px] text-muted-foreground/60 font-mono",children:[Math.round(b.before_pass_rate*100),"→",Math.round(b.after_pass_rate*100),"%"]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground/70",children:["#",i.slice(0,8)]}),a.length>1&&s.jsx("div",{className:"flex gap-0.5 ml-auto",children:a.map((j,C)=>s.jsx("div",{className:L("size-1.5 rounded-full",ns[j.action]??"bg-muted-foreground")},`${j.action}-${C}`))})]}),u.details&&s.jsx("p",{className:"text-[11px] text-muted-foreground/80 line-clamp-2 mt-1 leading-snug",children:u.details})]})]},i)})})]})}function de({text:e}){return s.jsxs(ht,{children:[s.jsx(ft,{className:"inline-flex items-center text-muted-foreground/50 hover:text-muted-foreground transition-colors cursor-help",onClick:t=>t.preventDefault(),children:s.jsx(aa,{className:"size-3"})}),s.jsx(pt,{side:"top",className:"max-w-[220px]",children:e})]})}const Xm={evolve:s.jsx(Ko,{className:"size-3 text-amber-500"}),watch:s.jsx(as,{className:"size-3 text-blue-500"}),skip:s.jsx(Qo,{className:"size-3 text-muted-foreground"})};function $i({action:e}){return s.jsxs("div",{className:"flex items-start gap-2 py-1",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:Xm[e.action]??null}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium truncate",children:e.skill}),s.jsx(H,{variant:e.rolledBack?"destructive":e.action==="evolve"&&e.deployed?"default":e.action==="evolve"?"secondary":e.action==="watch"?"outline":"secondary",className:"text-[10px] h-4 px-1.5 shrink-0",children:e.rolledBack?"rolled back":e.action==="evolve"&&e.deployed?"deployed":e.action==="evolve"?"evolved":e.action}),e.alert&&s.jsx(H,{variant:"destructive",className:"text-[10px] h-4 px-1.5 shrink-0",children:"alert"})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:e.reason})]})]})}function Jm({run:e}){const[t,n]=O.useState(!1),r=e.skill_actions.filter(a=>a.action!=="skip"),i=e.skill_actions.filter(a=>a.action==="skip");return s.jsxs(fa,{open:t,onOpenChange:n,children:[s.jsx(pa,{className:"w-full text-left",children:s.jsxs("div",{className:"flex items-start gap-3 py-2 hover:bg-muted/50 rounded-md px-2 -mx-2 transition-colors",children:[s.jsx("div",{className:`mt-1.5 size-2 shrink-0 rounded-full ${e.deployed>0?"bg-emerald-500":e.evolved>0?"bg-amber-400":"bg-muted-foreground/40"}`}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:_e(e.timestamp)}),e.dry_run&&s.jsx(H,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:"dry-run"}),e.approval_mode==="review"&&s.jsx(H,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:"review"})]}),s.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-muted-foreground",children:[e.deployed>0&&s.jsxs("span",{className:"text-emerald-600 font-medium",children:[e.deployed," deployed"]}),e.evolved>0&&s.jsxs("span",{children:[e.evolved," evolved"]}),e.watched>0&&s.jsxs("span",{children:[e.watched," watched"]}),e.skipped>0&&s.jsxs("span",{children:[e.skipped," skipped"]}),s.jsxs("span",{children:[(e.elapsed_ms/1e3).toFixed(1),"s"]})]})]}),s.jsx(Ot,{className:`size-4 text-muted-foreground shrink-0 mt-1 transition-transform duration-200 ${t?"rotate-90":""}`})]})}),s.jsx(ma,{children:s.jsxs("div",{className:"ml-5 pl-3 border-l border-border space-y-0.5 pb-2",children:[r.map((a,l)=>s.jsx($i,{action:a},`${a.skill}-${l}`)),i.length>0&&s.jsxs("details",{className:"group",children:[s.jsxs("summary",{className:"text-[11px] text-muted-foreground cursor-pointer hover:text-foreground py-1",children:[i.length," skipped"]}),s.jsx("div",{className:"space-y-0.5",children:i.map((a,l)=>s.jsx($i,{action:a},`${a.skill}-skip-${l}`))})]})]})})]})}function Zm({runs:e}){if(e.length===0)return s.jsxs(ne,{children:[s.jsx(se,{children:s.jsxs(ie,{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ms,{className:"size-4"}),"Orchestrate Runs"]})}),s.jsx(Ze,{children:s.jsxs("p",{className:"text-sm text-muted-foreground text-center py-4",children:["No orchestrate runs yet. Run"," ",s.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"selftune orchestrate"})," to start."]})})]});const t=e.reduce((n,r)=>n+r.deployed,0);return s.jsxs(ne,{children:[s.jsxs(se,{children:[s.jsxs(ie,{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ms,{className:"size-4"}),"Orchestrate Runs"]}),s.jsxs(ce,{children:[e.length," recent run",e.length!==1?"s":"",t>0&&s.jsxs(s.Fragment,{children:[" · ",t," total deployments"]})]})]}),s.jsx(Ze,{className:"space-y-0",children:e.slice(0,10).map(n=>s.jsx(Jm,{run:n},n.run_id))})]})}function ex({skillsCount:e,avgPassRate:t,unmatchedCount:n,sessionsCount:r,pendingCount:i,evidenceCount:a,hasEvolution:l=!0}){const o=t!==null?`${Math.round(t*100)}%`:"--",c=t!==null&&t>=.7;return s.jsxs("div",{className:"grid grid-cols-1 gap-4 px-4 *:data-[slot=card]:shadow-xs lg:px-6 @xl/main:grid-cols-2 @5xl/main:grid-cols-3",children:[s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(tr,{className:"size-3.5"}),"Skills Monitored",s.jsx(de,{text:"Total number of skills detected and being tracked by selftune"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:e}),s.jsx(Xe,{children:s.jsxs(H,{variant:"outline",children:[s.jsx(rn,{className:"size-3"}),"live"]})})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(ca,{className:"size-3.5"}),"Avg Trigger Rate",s.jsx(de,{text:"Average percentage of skill checks that resulted in a trigger across all graded skills (5+ checks). Run selftune evolve to improve this."})]}),s.jsx(ie,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${!c&&t!==null?"text-red-600":""}`,children:o}),s.jsx(Xe,{children:t!==null?s.jsxs(H,{variant:c?"outline":"destructive",children:[c?s.jsx(Zn,{className:"size-3"}):s.jsx(er,{className:"size-3"}),o]}):s.jsx(H,{variant:"secondary",className:"text-[10px]",children:"needs 5+ checks"})})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(ia,{className:"size-3.5"}),"Unmatched Queries",s.jsx(de,{text:"User prompts that didn't match any skill's trigger criteria — potential gaps in coverage"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:n}),n>0&&s.jsx(Xe,{children:s.jsxs(H,{variant:"destructive",children:[s.jsx(xt,{className:"size-3"}),"needs attention"]})})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(rn,{className:"size-3.5"}),"Sessions",s.jsx(de,{text:"Total agent sessions that have been recorded and analyzed"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:r})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(xt,{className:"size-3.5"}),"Pending Proposals",s.jsx(de,{text:"Evolution proposals that have been generated but not yet validated or deployed. Requires running selftune evolve."})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:l?i:"--"}),s.jsx(Xe,{children:l?i>0?s.jsx(H,{variant:"secondary",children:"awaiting review"}):null:s.jsx(H,{variant:"secondary",className:"text-[10px]",children:"no evolution runs yet"})})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(as,{className:"size-3.5"}),"Total Evidence",s.jsx(de,{text:"Number of evidence entries documenting skill changes with before/after validation results. Requires running selftune evolve."})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:l?a:"--"}),!l&&s.jsx(Xe,{children:s.jsx(H,{variant:"secondary",className:"text-[10px]",children:"no evolution runs yet"})})]})})]})}const yl=O.createContext(null);function tx(){const e=O.useContext(yl);return e?s.jsxs(ye,{ref:e.setActivatorNodeRef,...e.attributes,...e.listeners,variant:"ghost",size:"icon",className:"size-7 text-muted-foreground hover:bg-transparent",children:[s.jsx(Zo,{className:"size-3 text-muted-foreground"}),s.jsx("span",{className:"sr-only",children:"Drag to reorder"})]}):null}function nx(e){return[{id:"drag",header:()=>null,cell:()=>s.jsx(tx,{})},{id:"select",header:({table:t})=>s.jsx("div",{className:"flex items-center justify-center",children:s.jsx(Ls,{checked:t.getIsAllPageRowsSelected(),indeterminate:t.getIsSomePageRowsSelected()&&!t.getIsAllPageRowsSelected(),onCheckedChange:n=>t.toggleAllPageRowsSelected(!!n),"aria-label":"Select all"})}),cell:({row:t})=>s.jsx("div",{className:"flex items-center justify-center",children:s.jsx(Ls,{checked:t.getIsSelected(),onCheckedChange:n=>t.toggleSelected(!!n),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1},{accessorKey:"name",header:"Skill",cell:({row:t})=>e?e(t.original):s.jsx("span",{className:"text-sm font-medium",children:t.original.name}),enableHiding:!1},{accessorKey:"scope",header:"Scope",cell:({row:t})=>{const n=t.original.scope;return n?s.jsx(H,{variant:"secondary",className:"text-[10px]",children:n}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"--"})}},{accessorKey:"status",header:"Status",cell:({row:t})=>{const n=_r[t.original.status];return s.jsxs(H,{variant:n.variant,className:"gap-1 px-1.5 text-muted-foreground",children:[n.icon,n.label]})},sortingFn:(t,n)=>{const r={CRITICAL:0,WARNING:1,UNGRADED:2,UNKNOWN:3,HEALTHY:4};return r[t.original.status]-r[n.original.status]}},{accessorKey:"passRate",header:()=>s.jsx("div",{className:"w-full text-right",children:"Pass Rate"}),cell:({row:t})=>{const n=t.original.passRate,r=n!==null&&n<.5;return s.jsx("div",{className:`text-right font-mono tabular-nums ${r?"text-red-600 font-semibold":""}`,children:dt(n)})},sortingFn:(t,n)=>{const r=t.original.passRate??-1,i=n.original.passRate??-1;return r-i}},{accessorKey:"checks",header:()=>s.jsx("div",{className:"w-full text-right",children:"Checks"}),cell:({row:t})=>s.jsx("div",{className:"text-right font-mono tabular-nums",children:t.original.checks})},{accessorKey:"uniqueSessions",header:()=>s.jsx("div",{className:"w-full text-right",children:"Sessions"}),cell:({row:t})=>s.jsx("div",{className:"text-right font-mono tabular-nums",children:t.original.uniqueSessions})},{accessorKey:"lastSeen",header:"Last Seen",cell:({row:t})=>s.jsx("div",{className:"flex items-center gap-1 text-muted-foreground",children:t.original.lastSeen?s.jsxs(s.Fragment,{children:[s.jsx(ss,{className:"size-3"}),s.jsx("span",{className:"font-mono text-xs",children:_e(t.original.lastSeen)})]}):s.jsx("span",{className:"text-xs",children:"--"})}),sortingFn:(t,n)=>{const r=l=>{if(!l)return 0;const o=new Date(l).getTime();return Number.isNaN(o)?0:o},i=r(t.original.lastSeen),a=r(n.original.lastSeen);return i-a}},{accessorKey:"hasEvidence",header:"Evidence",cell:({row:t})=>s.jsx(H,{variant:t.original.hasEvidence?"outline":"secondary",className:"px-1.5 text-[10px] text-muted-foreground",children:t.original.hasEvidence?"Yes":"No"})}]}function rx({row:e}){const{transform:t,transition:n,setNodeRef:r,setActivatorNodeRef:i,isDragging:a,attributes:l,listeners:o}=Nc({id:e.original.name}),c=O.useMemo(()=>({attributes:l,listeners:o,setActivatorNodeRef:i}),[l,o,i]);return s.jsx(yl.Provider,{value:c,children:s.jsx(wn,{"data-state":e.getIsSelected()&&"selected","data-dragging":a,ref:r,className:"relative z-0 data-[dragging=true]:z-10 data-[dragging=true]:opacity-80",style:{transform:Sc.Transform.toString(t),transition:n},children:e.getVisibleCells().map(u=>s.jsx(jt,{children:da(u.column.columnDef.cell,u.getContext())},u.id))})})}function sx({cards:e,totalCount:t,statusFilter:n,onStatusFilterChange:r,renderSkillName:i}){var z;const[a,l]=O.useState("all"),[o,c]=O.useState([]),[u,d]=O.useState({}),[h,p]=O.useState({}),[f,b]=O.useState([]),[j,C]=O.useState([]),[y,E]=O.useState({pageIndex:0,pageSize:20}),v=O.useMemo(()=>nx(i),[i]),N=O.useMemo(()=>({all:e.length,attention:e.filter(k=>k.status==="CRITICAL"||k.status==="WARNING").length,recent:e.filter(k=>k.lastSeen!==null).length,ungraded:e.filter(k=>k.status==="UNGRADED"||k.status==="UNKNOWN").length}),[e]);O.useEffect(()=>{let k=e;a==="attention"?k=e.filter(F=>F.status==="CRITICAL"||F.status==="WARNING"):a==="recent"?k=e.filter(F=>F.lastSeen!==null).sort((F,M)=>{const _=F.lastSeen?new Date(F.lastSeen).getTime():0;return(M.lastSeen?new Date(M.lastSeen).getTime():0)-_}):a==="ungraded"&&(k=e.filter(F=>F.status==="UNGRADED"||F.status==="UNKNOWN")),c(k),E(F=>({...F,pageIndex:0}))},[e,a]);const D=O.useId(),w=ac(ur(wc,{}),ur(jc,{}),ur(vc,{coordinateGetter:yc})),P=lc({data:o,columns:v,state:{sorting:j,columnVisibility:h,rowSelection:u,columnFilters:f,pagination:y},getRowId:k=>k.name,enableRowSelection:!0,onRowSelectionChange:d,onSortingChange:C,onColumnFiltersChange:b,onColumnVisibilityChange:p,onPaginationChange:E,getCoreRowModel:bc(),getFilteredRowModel:gc(),getPaginationRowModel:xc(),getSortedRowModel:mc(),getFacetedRowModel:pc(),getFacetedUniqueValues:fc()}),B=O.useMemo(()=>P.getRowModel().rows.map(k=>k.id),[P.getRowModel().rows]),U=j.length>0;function $(k){if(U)return;const{active:F,over:M}=k;F&&M&&F.id!==M.id&&c(_=>{const W=_.map(Y=>Y.name),le=W.indexOf(F.id),A=W.indexOf(M.id);return le===-1||A===-1?_:kc(_,le,A)})}return s.jsxs(os,{value:a,onValueChange:l,className:"flex w-full flex-col justify-start gap-6",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 lg:px-6",children:[s.jsx(Us,{htmlFor:"view-selector",className:"sr-only",children:"View"}),s.jsxs(Hs,{value:a,onValueChange:k=>k&&l(k),children:[s.jsx(Vs,{className:"flex w-fit @4xl/main:hidden",size:"sm",id:"view-selector",children:s.jsx($s,{placeholder:"Select a view"})}),s.jsx(Qs,{children:s.jsxs(qs,{children:[s.jsx(un,{value:"all",children:"All Skills"}),s.jsx(un,{value:"attention",children:"Needs Attention"}),s.jsx(un,{value:"recent",children:"Recently Active"}),s.jsx(un,{value:"ungraded",children:"Ungraded"})]})})]}),s.jsxs(cs,{className:"hidden **:data-[slot=badge]:size-5 **:data-[slot=badge]:rounded-full **:data-[slot=badge]:bg-muted-foreground/30 **:data-[slot=badge]:px-1 @4xl/main:flex",children:[s.jsxs(He,{value:"all",children:["All Skills ",s.jsx(H,{variant:"secondary",children:N.all})]}),s.jsxs(He,{value:"attention",children:["Needs Attention"," ",N.attention>0&&s.jsx(H,{variant:"secondary",children:N.attention})]}),s.jsxs(He,{value:"recent",children:["Recently Active"," ",N.recent>0&&s.jsx(H,{variant:"secondary",children:N.recent})]}),s.jsxs(He,{value:"ungraded",children:["Ungraded"," ",N.ungraded>0&&s.jsx(H,{variant:"secondary",children:N.ungraded})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[r&&s.jsxs(Ds,{children:[s.jsxs(Fs,{render:s.jsx(ye,{variant:"outline",size:"sm"}),children:[s.jsx(Go,{"data-icon":"inline-start",className:"size-3.5"}),n&&n!=="ALL"?n.charAt(0)+n.slice(1).toLowerCase():"Status",s.jsx(At,{"data-icon":"inline-end"})]}),s.jsx(Bs,{align:"end",className:"w-40",children:s.jsx(_c,{value:n??"ALL",onValueChange:k=>r(k),children:[{label:"All",value:"ALL",icon:s.jsx(tr,{className:"size-3.5"})},{label:"Healthy",value:"HEALTHY",icon:s.jsx(Je,{className:"size-3.5 text-emerald-600"})},{label:"Warning",value:"WARNING",icon:s.jsx(xt,{className:"size-3.5 text-amber-500"})},{label:"Critical",value:"CRITICAL",icon:s.jsx(Me,{className:"size-3.5 text-red-500"})},{label:"Ungraded",value:"UNGRADED",icon:s.jsx(gt,{className:"size-3.5 text-muted-foreground"})},{label:"Unknown",value:"UNKNOWN",icon:s.jsx(Gn,{className:"size-3.5 text-muted-foreground/60"})}].map(k=>s.jsx(Tc,{value:k.value,children:s.jsxs("span",{className:"flex items-center gap-2",children:[k.icon,k.label]})},k.value))})})]}),s.jsxs(Ds,{children:[s.jsxs(Fs,{render:s.jsx(ye,{variant:"outline",size:"sm"}),children:[s.jsx(Wo,{"data-icon":"inline-start"}),"Columns",s.jsx(At,{"data-icon":"inline-end"})]}),s.jsx(Bs,{align:"end",className:"w-40",children:P.getAllColumns().filter(k=>typeof k.accessorFn<"u"&&k.getCanHide()).map(k=>s.jsx(Ic,{className:"capitalize",checked:k.getIsVisible(),onCheckedChange:F=>k.toggleVisibility(!!F),children:k.id==="scope"?"Scope":k.id==="passRate"?"Pass Rate":k.id==="uniqueSessions"?"Sessions":k.id==="lastSeen"?"Last Seen":k.id==="hasEvidence"?"Evidence":k.id},k.id))})]})]})]}),s.jsxs(Rt,{value:a,className:"relative flex flex-col gap-4 overflow-auto px-4 lg:px-6",children:[s.jsx("div",{className:"overflow-hidden rounded-lg border",children:s.jsx(oc,{collisionDetection:uc,modifiers:[cc],onDragEnd:$,sensors:w,id:D,children:s.jsxs(xa,{children:[s.jsx(ga,{className:"sticky top-0 z-10 bg-muted",children:P.getHeaderGroups().map(k=>s.jsx(wn,{children:k.headers.map(F=>s.jsx(Ht,{colSpan:F.colSpan,className:F.column.getCanSort()?"cursor-pointer select-none":"",onClick:F.column.getToggleSortingHandler(),children:s.jsxs("div",{className:"flex items-center gap-1",children:[F.isPlaceholder?null:da(F.column.columnDef.header,F.getContext()),F.column.getIsSorted()==="asc"?" ↑":F.column.getIsSorted()==="desc"?" ↓":null]})},F.id))},k.id))}),s.jsx(ba,{className:"**:data-[slot=table-cell]:first:w-8",children:(z=P.getRowModel().rows)!=null&&z.length?s.jsx(dc,{items:B,strategy:hc,children:P.getRowModel().rows.map(k=>s.jsx(rx,{row:k},k.id))}):s.jsx(wn,{children:s.jsx(jt,{colSpan:v.length,className:"h-24 text-center text-muted-foreground",children:t===0?"No skills detected yet. Trigger some skills to see data.":"No skills match your filters."})})})]})})}),s.jsxs("div",{className:"flex items-center justify-between px-4",children:[s.jsxs("div",{className:"hidden flex-1 text-sm text-muted-foreground lg:flex",children:[P.getFilteredSelectedRowModel().rows.length," of"," ",P.getFilteredRowModel().rows.length," skill(s) selected."]}),s.jsxs("div",{className:"flex w-full items-center gap-8 lg:w-fit",children:[s.jsxs("div",{className:"hidden items-center gap-2 lg:flex",children:[s.jsx(Us,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),s.jsxs(Hs,{value:`${P.getState().pagination.pageSize}`,onValueChange:k=>{P.setPageSize(Number(k))},items:[10,20,50,100].map(k=>({label:`${k}`,value:`${k}`})),children:[s.jsx(Vs,{size:"sm",className:"w-20",id:"rows-per-page",children:s.jsx($s,{placeholder:P.getState().pagination.pageSize})}),s.jsx(Qs,{side:"top",children:s.jsx(qs,{children:[10,20,50,100].map(k=>s.jsx(un,{value:`${k}`,children:k},k))})})]})]}),P.getRowModel().rows.length>0&&s.jsxs("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",P.getState().pagination.pageIndex+1," of ",P.getPageCount()]}),s.jsxs("div",{className:"ml-auto flex items-center gap-2 lg:ml-0",children:[s.jsxs(ye,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>P.setPageIndex(0),disabled:!P.getCanPreviousPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to first page"}),s.jsx(Yo,{})]}),s.jsxs(ye,{variant:"outline",className:"size-8",size:"icon",onClick:()=>P.previousPage(),disabled:!P.getCanPreviousPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to previous page"}),s.jsx(Xo,{})]}),s.jsxs(ye,{variant:"outline",className:"size-8",size:"icon",onClick:()=>P.nextPage(),disabled:!P.getCanNextPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to next page"}),s.jsx(Ot,{})]}),s.jsxs(ye,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>P.setPageIndex(P.getPageCount()-1),disabled:!P.getCanNextPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to last page"}),s.jsx(Jo,{})]})]})]})]})]})]})}const ix=6e4;function ax(){return rr({queryKey:["orchestrate-runs"],queryFn:()=>rd(20),staleTime:5e3,refetchInterval:ix})}function lx(e){return ha(e.map(t=>({name:t.skill_name,scope:t.skill_scope,passRate:t.total_checks>0?t.pass_rate:null,checks:t.total_checks,status:ls(t.pass_rate,t.total_checks),hasEvidence:t.has_evidence,uniqueSessions:t.unique_sessions,lastSeen:t.last_seen})))}function ox({skillCount:e}){const[t,n]=O.useState(()=>{try{return localStorage.getItem("selftune-onboarding-dismissed")==="true"}catch{return!1}});if(!(!t||e===0))return null;const i=()=>{n(!0);try{localStorage.setItem("selftune-onboarding-dismissed","true")}catch{}};return e===0?s.jsx("div",{className:"mx-4 lg:mx-6 rounded-xl border-2 border-dashed border-primary/30 bg-primary/5 p-8",children:s.jsxs("div",{className:"flex flex-col items-center text-center gap-4 max-w-md mx-auto",children:[s.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-primary/10",children:s.jsx(qn,{className:"size-6 text-primary"})}),s.jsx("h2",{className:"text-lg font-semibold",children:"Welcome to selftune"}),s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"No skills detected yet. Once you start using selftune in your project, skills will appear here automatically."}),s.jsxs("div",{className:"grid grid-cols-1 gap-3 w-full text-left sm:grid-cols-3",children:[s.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border bg-card p-3",children:[s.jsx("div",{className:"flex items-center justify-center size-6 rounded-full bg-blue-500/10 text-blue-500 shrink-0 text-xs font-bold",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium",children:"Run selftune"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Enable selftune in your project to start tracking skills"})]})]}),s.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border bg-card p-3",children:[s.jsx("div",{className:"flex items-center justify-center size-6 rounded-full bg-amber-500/10 text-amber-500 shrink-0 text-xs font-bold",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium",children:"Skills appear"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Skills are detected and monitored automatically"})]})]}),s.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border bg-card p-3",children:[s.jsx("div",{className:"flex items-center justify-center size-6 rounded-full bg-emerald-500/10 text-emerald-500 shrink-0 text-xs font-bold",children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium",children:"Watch evolution"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Proposals flow in with validated improvements"})]})]})]})]})}):s.jsxs("div",{className:"mx-4 lg:mx-6 flex items-center gap-3 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3",children:[s.jsx(qn,{className:"size-4 text-primary/60 shrink-0"}),s.jsxs("p",{className:"flex-1 text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-medium text-foreground",children:"Welcome to selftune dashboard."})," Hover over any metric label's"," ",s.jsx("span",{className:"inline-flex items-center text-muted-foreground/50",children:s.jsx(tr,{className:"size-2.5 mx-0.5"})})," ","icon for an explanation. Click proposals in the Evolution timeline to see detailed evidence."]}),s.jsxs("button",{type:"button",onClick:i,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:[s.jsx(ra,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})}function cx({search:e,statusFilter:t,onStatusFilterChange:n,overviewQuery:r}){const i=Tl(),{data:a,isPending:l,isError:o,error:c,refetch:u}=r,d=ax(),h=O.useMemo(()=>a?lx(a.skills):[],[a]),p=O.useMemo(()=>{let E=h;if(e){const v=e.toLowerCase();E=E.filter(N=>N.name.toLowerCase().includes(v))}return t!=="ALL"&&(E=E.filter(v=>v.status===t)),E},[h,e,t]);if(l)return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 py-6",children:[s.jsx("div",{className:"grid grid-cols-1 gap-4 px-4 lg:px-6 @xl/main:grid-cols-2 @5xl/main:grid-cols-3",children:Array.from({length:6}).map((E,v)=>s.jsx(qe,{className:"h-24 rounded-xl"},v))}),s.jsxs("div",{className:"px-4 lg:px-6",children:[s.jsx(qe,{className:"h-8 w-32 mb-4"}),s.jsx("div",{className:"grid grid-cols-1 gap-3 @xl/main:grid-cols-2 @5xl/main:grid-cols-3",children:Array.from({length:6}).map((E,v)=>s.jsx(qe,{className:"h-28 rounded-xl"},v))})]})]});if(o)return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-16",children:[s.jsx(nr,{className:"size-10 text-destructive"}),s.jsx("p",{className:"text-sm font-medium text-destructive",children:c instanceof Error?c.message:"Unknown error"}),s.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>u(),children:[s.jsx($n,{className:"mr-2 size-3.5"}),"Retry"]})]});if(!a)return s.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 py-16",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No telemetry data found. Run some sessions first."})});const{overview:f,skills:b}=a,j=b.filter(E=>E.total_checks>=5),C=j.length>0?j.reduce((E,v)=>E+v.pass_rate,0)/j.length:null,y=(E,v)=>{i(`/skills/${encodeURIComponent(E)}?proposal=${encodeURIComponent(v)}`)};return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 py-6",children:[s.jsx(ox,{skillCount:b.length}),s.jsx(ex,{skillsCount:b.length,avgPassRate:C,unmatchedCount:f.unmatched_queries.length,sessionsCount:f.counts.sessions,pendingCount:f.pending_proposals.length,evidenceCount:f.counts.evidence,hasEvolution:f.counts.evolution>0}),s.jsxs("div",{className:"grid grid-cols-1 gap-6 @5xl/main:grid-cols-[1fr_320px]",children:[s.jsx(sx,{cards:p,totalCount:h.length,statusFilter:t,onStatusFilterChange:n,renderSkillName:E=>s.jsx(wt,{to:`/skills/${encodeURIComponent(E.name)}`,className:"text-sm font-medium hover:underline",children:E.name})}),s.jsx("div",{className:"px-4 lg:px-6 @5xl/main:px-0 @5xl/main:pr-4 lg:@5xl/main:pr-6",children:s.jsxs("div",{className:"sticky top-4 space-y-4",children:[s.jsx(od,{evolution:f.evolution,pendingProposals:f.pending_proposals,unmatchedQueries:f.unmatched_queries,onSelectProposal:y}),d.isPending?s.jsx(qe,{className:"h-32 rounded-xl"}):d.isError?s.jsx("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive",children:"Failed to load orchestrate runs."}):s.jsx(Zm,{runs:d.data.runs})]})})]})]})}const ux=6e4;function dx(e){return rr({queryKey:["skill-report",e],queryFn:()=>nd(e),enabled:!!e,staleTime:5e3,refetchInterval:ux,retry:(t,n)=>n instanceof La?!1:t<2})}function Vi(e){if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=t/60;return n<60?`${n.toFixed(1)}m`:`${(n/60).toFixed(1)}h`}const hx={created:"outline",validated:"secondary",deployed:"default",rejected:"destructive",rolled_back:"destructive"};function fx({sessionId:e,meta:t,invocations:n,defaultExpanded:r}){var c;const[i,a]=O.useState(r),l=(t==null?void 0:t.started_at)??((c=n[0])==null?void 0:c.timestamp),o=n.reduce((u,d)=>{const h=d.invocation_mode??"unknown";return u[h]=(u[h]??0)+1,u},{});return s.jsxs("div",{className:"rounded-lg border border-border/60 overflow-hidden transition-colors",children:[s.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-muted/40 active:bg-muted/60 transition-colors",onClick:()=>a(!i),children:[s.jsx(Ot,{className:`size-3.5 text-muted-foreground shrink-0 transition-transform duration-150 ${i?"rotate-90":""}`}),s.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm font-medium",children:[n.length," invocation",n.length!==1?"s":""]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:l?_e(l):""})]}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(t==null?void 0:t.model)&&s.jsx(H,{variant:"secondary",className:"text-[10px] font-normal",children:t.model}),(t==null?void 0:t.workspace_path)&&s.jsx("span",{className:"text-[11px] text-muted-foreground font-mono",title:t.workspace_path,children:t.workspace_path.split("/").slice(-2).join("/")})]})]}),!i&&s.jsx("div",{className:"flex items-center gap-1 shrink-0",children:Object.entries(o).map(([u,d])=>s.jsxs(H,{variant:"outline",className:"text-[10px] font-normal gap-1",children:[u," ",s.jsx("span",{className:"text-muted-foreground",children:d})]},u))}),s.jsx("span",{className:"text-[10px] text-muted-foreground/40 font-mono shrink-0",children:e.substring(0,8)})]}),i&&s.jsx("div",{className:"border-t border-border/40 overflow-x-auto",children:s.jsxs(xa,{children:[s.jsx(ga,{children:s.jsxs(wn,{className:"hover:bg-transparent bg-muted/40",children:[s.jsxs(Ht,{className:"text-[11px] h-8",children:["Prompt ",s.jsx(de,{text:"The user prompt that led to this skill being invoked"})]}),s.jsxs(Ht,{className:"text-[11px] h-8 w-[90px]",children:["Mode"," ",s.jsx(de,{text:"explicit = user typed /skillname · implicit = user mentioned skill by name · inferred = agent chose skill autonomously"})]}),s.jsxs(Ht,{className:"text-[11px] h-8 w-[70px]",children:["Confidence"," ",s.jsx(de,{text:"Model's confidence score (0–100%) when routing this prompt to the skill"})]}),s.jsxs(Ht,{className:"text-[11px] h-8 w-[90px]",children:["Agent"," ",s.jsx(de,{text:"Which agent invoked the skill — main agent or a subagent type (e.g. Explore, Engineer)"})]}),s.jsx(Ht,{className:"text-[11px] h-8 w-[70px] text-right",children:"Time"})]})}),s.jsx(ba,{children:n.map((u,d)=>s.jsxs(wn,{className:u.triggered?"":"bg-destructive/5",children:[s.jsxs(jt,{className:"max-w-[500px] truncate text-sm py-2",title:u.query||void 0,children:[u.query||s.jsx("span",{className:"text-muted-foreground/40 italic",children:"No prompt recorded"}),!u.triggered&&s.jsx(H,{variant:"destructive",className:"text-[10px] font-normal ml-2",children:"missed"})]}),s.jsx(jt,{className:"py-2",children:u.invocation_mode?s.jsx(H,{variant:"secondary",className:"text-[10px] font-normal",children:u.invocation_mode}):s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"—"})}),s.jsx(jt,{className:"py-2 font-mono text-xs text-muted-foreground tabular-nums",children:u.confidence!==null?`${Math.round(u.confidence*100)}%`:"—"}),s.jsx(jt,{className:"py-2",children:u.agent_type?s.jsx(H,{variant:"outline",className:"text-[10px] font-normal",children:u.agent_type}):s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"—"})}),s.jsx(jt,{className:"py-2 font-mono text-[11px] text-muted-foreground text-right whitespace-nowrap",children:u.timestamp?_e(u.timestamp):""})]},d))})]})})]})}function px(){var _,W,le;const{name:e}=zl(),[t,n]=Pl(),{data:r,isPending:i,isError:a,error:l,refetch:o}=dx(e),c=(r==null?void 0:r.evolution)??[],u=new Set(c.map(A=>A.proposal_id)),d=t.get("proposal"),h=d&&u.has(d)?d:c.length>0?c[0].proposal_id:null;O.useEffect(()=>{const A=t.get("proposal");if(h&&A!==h){const Y=new URLSearchParams(t);Y.set("proposal",h),n(Y,{replace:!0});return}if(!h&&A){const Y=new URLSearchParams(t);Y.delete("proposal"),n(Y,{replace:!0})}},[h,t,n]);const p=A=>{const Y=new URLSearchParams(t);Y.set("proposal",A),n(Y,{replace:!0})};if(!e)return s.jsx("div",{className:"flex flex-1 items-center justify-center py-16",children:s.jsx("p",{className:"text-sm text-destructive",children:"No skill name provided"})});if(i)return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 p-4 lg:p-6",children:[s.jsx(qe,{className:"h-10 w-64"}),s.jsx("div",{className:"grid grid-cols-1 gap-4 @xl/main:grid-cols-2 @5xl/main:grid-cols-4",children:Array.from({length:8}).map((A,Y)=>s.jsx(qe,{className:"h-24 rounded-xl"},Y))}),s.jsx(qe,{className:"h-20 rounded-xl"}),s.jsx(qe,{className:"h-64 rounded-xl"})]});if(a)return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-16",children:[s.jsx(nr,{className:"size-10 text-destructive"}),s.jsx("p",{className:"text-sm font-medium text-destructive",children:l instanceof Error?l.message:"Unknown error"}),s.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>o(),children:[s.jsx($n,{className:"mr-2 size-3.5"}),"Retry"]})]});if(!r)return s.jsx("div",{className:"flex flex-1 items-center justify-center py-16",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No data yet"})});if(r.usage.total_checks===0&&r.usage.triggered_count===0&&r.evidence.length===0&&r.evolution.length===0&&r.pending_proposals.length===0&&(((_=r.canonical_invocations)==null?void 0:_.length)??0)===0&&(((W=r.prompt_samples)==null?void 0:W.length)??0)===0&&(((le=r.session_metadata)==null?void 0:le.length)??0)===0)return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-16",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No data found for skill "',e,'".']}),s.jsxs(ye,{variant:"outline",size:"sm",render:s.jsx(wt,{to:"/"}),children:[s.jsx(ec,{className:"mr-2 size-3.5"}),"Back to Overview"]})]});const{usage:b,evidence:j,pending_proposals:C,canonical_invocations:y,duration_stats:E,selftune_stats:v,prompt_samples:N,session_metadata:D}=r,w=ls(b.pass_rate,b.total_checks),P=_r[w]??_r.UNKNOWN,B=w==="HEALTHY",U=((v==null?void 0:v.run_count)??0)>0,$=(E==null?void 0:E.missed_triggers)??0;[...new Set((D??[]).map(A=>A.model).filter(Boolean))],[...new Set((D??[]).map(A=>A.platform).filter(Boolean))],[...new Set((D??[]).map(A=>A.workspace_path).filter(Boolean))];const z=(y??[]).map(A=>({timestamp:A.timestamp||A.occurred_at||null,session_id:A.session_id,triggered:A.triggered,query:A.query??"",source:A.source??"",invocation_mode:A.invocation_mode??null,confidence:A.confidence??null,tool_name:A.tool_name??null,agent_type:A.agent_type??null}));z.sort((A,Y)=>(Y.timestamp??"").localeCompare(A.timestamp??""));const k=new Map;for(const A of z){const Y=A.session_id??"unknown",m=k.get(Y);m?m.push(A):k.set(Y,[A])}const F=new Map((D??[]).map(A=>[A.session_id,A])),M=[...k.entries()].sort(([,A],[,Y])=>{var m,me;return(((m=Y[0])==null?void 0:m.timestamp)??"").localeCompare(((me=A[0])==null?void 0:me.timestamp)??"")});return s.jsx(os,{defaultValue:c.length>0?"evidence":"invocations",children:s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-4 p-4 lg:px-6 lg:pb-6 lg:pt-0",children:[s.jsxs("div",{className:"flex items-center gap-3 sticky top-0 z-30 bg-background py-1.5 border-b border-border/50",children:[s.jsx("h1",{className:"text-base font-semibold tracking-tight lg:text-lg shrink-0",children:r.skill_name}),s.jsxs(H,{variant:P.variant,className:"gap-1 shrink-0 text-[10px]",children:[P.icon,P.label]}),s.jsxs(cs,{variant:"line",className:"ml-auto",children:[c.length>0&&s.jsxs(ht,{children:[s.jsxs(ft,{render:s.jsx(He,{value:"evidence"}),children:["Evidence",h&&s.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:["#",h.slice(0,8)]})]}),s.jsx(pt,{children:"Change history and validation results"})]}),s.jsxs(ht,{children:[s.jsxs(ft,{render:s.jsx(He,{value:"invocations"}),children:["Invocations",s.jsx(H,{variant:"secondary",className:"text-[10px]",children:z.length})]}),s.jsx(pt,{children:"Recent skill triggers and their outcomes"})]}),C.length>0&&s.jsxs(ht,{children:[s.jsxs(ft,{render:s.jsx(He,{value:"pending"}),children:["Pending",s.jsx(H,{variant:"destructive",className:"text-[10px]",children:C.length})]}),s.jsx(pt,{children:"Proposals awaiting review"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 @xl/main:grid-cols-2 @5xl/main:grid-cols-4",children:[s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(ca,{className:"size-3.5"}),"Trigger Rate",s.jsx(de,{text:"Percentage of skill checks that resulted in this skill being triggered"})]}),s.jsx(ie,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${b.total_checks>0&&!B?"text-red-600":""}`,children:b.total_checks>0?dt(b.pass_rate):"--"}),s.jsx(Xe,{children:b.total_checks>0?s.jsxs(H,{variant:B?"outline":"destructive",children:[B?s.jsx(Zn,{className:"size-3"}):s.jsx(er,{className:"size-3"}),dt(b.pass_rate)]}):s.jsx(H,{variant:"secondary",className:"text-[10px]",children:"no checks yet"})})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(tr,{className:"size-3.5"}),"Total Checks",s.jsx(de,{text:"Total evaluation checks run across all sessions for this skill"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:b.total_checks})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(rn,{className:"size-3.5"}),"Triggered",s.jsx(de,{text:"Number of times this skill was invoked by the agent during sessions"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:b.triggered_count})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(as,{className:"size-3.5"}),"Sessions",s.jsx(de,{text:"Number of unique agent sessions where this skill was present"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:r.sessions_with_skill})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(tc,{className:"size-3.5"}),"LLM Calls",s.jsx(de,{text:"Total LLM calls made by selftune when evolving this skill"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:U?(v==null?void 0:v.total_llm_calls)??0:"--"}),s.jsx(Xe,{children:U?s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[(v==null?void 0:v.run_count)??0," evolution runs"]}):s.jsx(H,{variant:"secondary",className:"text-[10px]",children:"no evolution runs yet"})})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(ss,{className:"size-3.5"}),"Avg Duration",s.jsx(de,{text:"Average time selftune spent evolving this skill per run"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:U?Vi((v==null?void 0:v.avg_elapsed_ms)??0):"--"}),s.jsx(Xe,{children:U?s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[Vi((v==null?void 0:v.total_elapsed_ms)??0)," total"]}):s.jsx(H,{variant:"secondary",className:"text-[10px]",children:"no evolution runs yet"})})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(nc,{className:"size-3.5"}),"Missed Triggers",s.jsx(de,{text:"Number of times this skill was evaluated but did not trigger. High counts may indicate the skill description needs evolution."})]}),s.jsx(ie,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${$>0?"text-amber-600":""}`,children:$})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(rc,{className:"size-3.5"}),"Avg Confidence",s.jsx(de,{text:"Average model confidence score when routing user prompts to this skill"})]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:(()=>{const A=z.filter(Y=>Y.confidence!==null);return A.length>0?dt(A.reduce((Y,m)=>Y+(m.confidence??0),0)/A.length):"--"})()})]})})]}),s.jsxs("div",{className:"flex gap-6",children:[c.length>0&&s.jsx("aside",{className:"w-[220px] shrink-0 border-r pr-4 sticky top-12 self-start max-h-[calc(100svh-3rem)] overflow-y-auto",children:s.jsx(Ym,{entries:c,selectedProposalId:h,onSelect:p})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[c.length>0&&s.jsx(Rt,{value:"evidence",children:h?s.jsx(Bm,{proposalId:h,evolution:c,evidence:j}):s.jsx("div",{className:"flex items-center justify-center rounded-lg border border-dashed py-12",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a proposal from the timeline"})})}),s.jsx(Rt,{value:"invocations",children:z.length===0?s.jsx(ne,{children:s.jsx(Ze,{className:"py-12",children:s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"No invocation records yet."})})}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:[z.length," invocations across ",M.length," ","sessions"]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(H,{variant:"secondary",className:"text-[9px] font-normal",children:"explicit"})," ","user typed /skill"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(H,{variant:"secondary",className:"text-[9px] font-normal",children:"implicit"})," ","mentioned by name"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(H,{variant:"secondary",className:"text-[9px] font-normal",children:"inferred"})," ","agent chose autonomously"]})]})]}),M.map(([A,Y],m)=>{const me=F.get(A);return s.jsx(fx,{sessionId:A,meta:me,invocations:Y,defaultExpanded:m<3},A)})]})}),C.length>0&&s.jsx(Rt,{value:"pending",children:s.jsxs(ne,{children:[s.jsxs(se,{children:[s.jsx(ie,{className:"text-sm",children:"Pending Proposals"}),s.jsxs(ce,{children:[C.length," awaiting review"]})]}),s.jsx(Ze,{className:"space-y-3",children:C.map(A=>s.jsxs("button",{type:"button",onClick:()=>p(A.proposal_id),className:"flex gap-3 rounded-lg border p-3 w-full text-left hover:bg-accent/50 transition-colors",children:[s.jsx("div",{className:"mt-0.5 size-2 shrink-0 rounded-full bg-amber-400"}),s.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{variant:hx[A.action]??"secondary",className:"text-[10px]",children:A.action}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:_e(A.timestamp)}),s.jsxs("span",{className:"text-[10px] text-muted-foreground/60 font-mono ml-auto",children:["#",A.proposal_id.slice(0,8)]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:A.details})]})]},A.proposal_id))})]})})]})]})]})})}const mx=6e4;function xx(){return rr({queryKey:["doctor"],queryFn:sd,staleTime:5e3,refetchInterval:mx})}const gx={pass:{icon:s.jsx(Je,{className:"size-4 text-emerald-600"}),variant:"outline",label:"Pass"},warn:{icon:s.jsx(xt,{className:"size-4 text-amber-500"}),variant:"secondary",label:"Warning"},fail:{icon:s.jsx(Me,{className:"size-4 text-red-500"}),variant:"destructive",label:"Fail"}},bx={config:{label:"Configuration",description:"selftune.json exists and contains valid agent_type and llm_mode",icon:s.jsx(ic,{className:"size-4 text-muted-foreground"})},log_session_telemetry:{label:"Session Telemetry Log",description:"session_telemetry_log.jsonl exists and records parse correctly",icon:s.jsx(mn,{className:"size-4 text-muted-foreground"})},log_skill_usage:{label:"Skill Usage Log",description:"skill_usage_log.jsonl exists and records parse correctly",icon:s.jsx(mn,{className:"size-4 text-muted-foreground"})},log_all_queries:{label:"Query Log",description:"all_queries_log.jsonl exists and records parse correctly",icon:s.jsx(mn,{className:"size-4 text-muted-foreground"})},log_evolution_audit:{label:"Evolution Audit Log",description:"evolution_audit_log.jsonl exists and records parse correctly",icon:s.jsx(mn,{className:"size-4 text-muted-foreground"})},hook_settings:{label:"Hook Installation",description:"Claude Code settings.json has all required selftune hooks configured",icon:s.jsx(sc,{className:"size-4 text-muted-foreground"})},evolution_audit:{label:"Evolution Health",description:"Evolution audit log is intact and records are well-formed",icon:s.jsx(is,{className:"size-4 text-muted-foreground"})},dashboard_freshness_mode:{label:"Dashboard Freshness",description:"The current dashboard still invalidates live updates from JSONL log watchers. SQLite WAL live invalidation has not been cut over yet.",icon:s.jsx(ua,{className:"size-4 text-muted-foreground"})}};function yx({check:e}){const t=bx[e.name]??{label:e.name,description:"",icon:s.jsx(ua,{className:"size-4 text-muted-foreground"})},n=gx[e.status]??{icon:s.jsx(nr,{className:"size-4 text-muted-foreground"}),variant:"outline",label:e.status};return s.jsxs(ne,{children:[s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[t.icon,t.label,t.description&&s.jsx(de,{text:t.description})]}),s.jsx(ie,{className:"text-sm font-medium",children:e.message||"No details"}),s.jsx(Xe,{children:s.jsxs(H,{variant:n.variant,className:"gap-1",children:[n.icon,n.label]})})]}),e.path&&s.jsx(Ze,{className:"pt-0",children:s.jsx("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.path})})]})}function vx(){const{data:e,isPending:t,isError:n,error:r,refetch:i}=xx();if(t)return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 p-4 lg:p-6",children:[s.jsx(qe,{className:"h-8 w-48"}),s.jsx("div",{className:"grid grid-cols-1 gap-4 @xl/main:grid-cols-2",children:Array.from({length:7}).map((N,D)=>s.jsx(qe,{className:"h-24 rounded-xl"},D))})]});if(n)return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-16",children:[s.jsx(nr,{className:"size-10 text-destructive"}),s.jsx("p",{className:"text-sm font-medium text-destructive",children:r instanceof Error?r.message:"Unknown error"}),s.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>i(),children:[s.jsx($n,{className:"mr-2 size-3.5"}),"Retry"]})]});if(!e)return s.jsx("div",{className:"flex flex-1 items-center justify-center py-16",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No diagnostics data available."})});const{checks:a,summary:l,healthy:o=!1,timestamp:c}=e,u=a??[],d=l??{pass:0,warn:0,fail:0},h=u.find(N=>N.name==="dashboard_freshness_mode"),p=u.filter(N=>N.name==="config"),f=u.filter(N=>N.name.startsWith("log_")),b=u.filter(N=>N.name==="hook_settings"),j=u.filter(N=>N.name==="evolution_audit"),C=u.filter(N=>N.name==="dashboard_freshness_mode"),y=new Set(["config",...f.map(N=>N.name),"hook_settings","evolution_audit","dashboard_freshness_mode"]),E=u.filter(N=>!y.has(N.name)),v=[{title:"Configuration",checks:p},{title:"Log Files",checks:f},{title:"Hooks",checks:b},{title:"Evolution",checks:j},{title:"Integrity",checks:C},{title:"Other",checks:E}].filter(N=>N.checks.length>0);return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 p-4 lg:p-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(sa,{className:"size-5 text-muted-foreground"}),s.jsx("h1",{className:"text-base font-semibold tracking-tight lg:text-lg",children:"System Status"}),s.jsxs(H,{variant:o?"outline":"destructive",className:"gap-1",children:[o?s.jsx(Je,{className:"size-3 text-emerald-600"}):s.jsx(Me,{className:"size-3"}),o?"Healthy":"Unhealthy"]}),s.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:["Last checked ",c?_e(c):"—"]}),s.jsx(ye,{"aria-label":"Refresh status",title:"Refresh status",variant:"ghost",size:"sm",onClick:()=>i(),className:"shrink-0",children:s.jsx($n,{className:"size-3.5"})})]}),(h==null?void 0:h.status)==="warn"&&s.jsx(ne,{className:"border-amber-200 bg-amber-50/60 dark:border-amber-900/50 dark:bg-amber-950/20",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5 text-amber-800 dark:text-amber-300",children:[s.jsx(xt,{className:"size-4"}),"Legacy freshness mode active"]}),s.jsx(ie,{className:"text-sm font-medium text-amber-950 dark:text-amber-100",children:h.message})]})}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 px-0",children:[s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(Je,{className:"size-3.5 text-emerald-600"}),"Passed"]}),s.jsx(ie,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:d.pass})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(xt,{className:"size-3.5 text-amber-500"}),"Warnings"]}),s.jsx(ie,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${d.warn>0?"text-amber-500":""}`,children:d.warn})]})}),s.jsx(ne,{className:"@container/card",children:s.jsxs(se,{children:[s.jsxs(ce,{className:"flex items-center gap-1.5",children:[s.jsx(Me,{className:"size-3.5 text-red-500"}),"Failed"]}),s.jsx(ie,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${d.fail>0?"text-red-600":""}`,children:d.fail})]})})]}),v.map(N=>s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:N.title}),s.jsx("div",{className:"grid grid-cols-1 gap-3 @xl/main:grid-cols-2",children:N.checks.map((D,w)=>s.jsx(yx,{check:D},`${D.name}-${w}`))})]},N.title))]})}const jx=new su({defaultOptions:{queries:{refetchOnWindowFocus:!0,gcTime:300*1e3}}});function wx(){return s.jsxs(s.Fragment,{children:[s.jsx(ms,{}),s.jsx(px,{})]})}function kx(){return s.jsxs(s.Fragment,{children:[s.jsx(ms,{}),s.jsx(vx,{})]})}function Nx(){ld();const[e,t]=O.useState(""),[n,r]=O.useState("ALL"),i=ad(),{data:a}=i,l=O.useMemo(()=>a?ha(a.skills.map(c=>({name:c.skill_name,scope:c.skill_scope,status:ls(c.pass_rate,c.total_checks),passRate:c.total_checks>0?c.pass_rate:null,checks:c.total_checks}))):[],[a]),o=O.useMemo(()=>{if(!e)return l;const c=e.toLowerCase();return l.filter(u=>u.name.toLowerCase().includes(c))},[l,e]);return s.jsxs(Ru,{children:[s.jsx(Ku,{skills:o,search:e,onSearchChange:t,version:a==null?void 0:a.version}),s.jsx(Mu,{children:s.jsxs(Al,{children:[s.jsx(cr,{path:"/",element:s.jsxs(s.Fragment,{children:[s.jsx(ms,{}),s.jsx(cx,{search:e,statusFilter:n,onStatusFilterChange:r,overviewQuery:i})]})}),s.jsx(cr,{path:"/skills/:name",element:s.jsx(wx,{})}),s.jsx(cr,{path:"/status",element:s.jsx(kx,{})})]})}),s.jsx(Wu,{})]})}function Sx(){return s.jsx(iu,{client:jx,children:s.jsx(Rl,{children:s.jsx(Ju,{defaultTheme:"dark",children:s.jsx(ya,{children:s.jsx(Nx,{})})})})})}Ol.createRoot(document.getElementById("root")).render(s.jsx(O.StrictMode,{children:s.jsx(Sx,{})}));
|