selftune 0.2.2 → 0.2.5

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.
Files changed (53) hide show
  1. package/README.md +11 -0
  2. package/apps/local-dashboard/dist/assets/index-C75H1Q3n.css +1 -0
  3. package/apps/local-dashboard/dist/assets/index-axE4kz3Q.js +15 -0
  4. package/apps/local-dashboard/dist/assets/vendor-ui-r2k_Ku_V.js +346 -0
  5. package/apps/local-dashboard/dist/index.html +3 -3
  6. package/cli/selftune/analytics.ts +354 -0
  7. package/cli/selftune/badge/badge.ts +2 -2
  8. package/cli/selftune/dashboard-server.ts +3 -3
  9. package/cli/selftune/evolution/evolve-body.ts +1 -1
  10. package/cli/selftune/evolution/evolve.ts +1 -1
  11. package/cli/selftune/index.ts +15 -1
  12. package/cli/selftune/init.ts +5 -1
  13. package/cli/selftune/observability.ts +63 -2
  14. package/cli/selftune/orchestrate.ts +1 -1
  15. package/cli/selftune/quickstart.ts +1 -1
  16. package/cli/selftune/status.ts +2 -2
  17. package/cli/selftune/types.ts +1 -0
  18. package/cli/selftune/utils/llm-call.ts +2 -1
  19. package/package.json +5 -3
  20. package/packages/ui/README.md +113 -0
  21. package/packages/ui/index.ts +10 -0
  22. package/packages/ui/package.json +62 -0
  23. package/packages/ui/src/components/ActivityTimeline.tsx +171 -0
  24. package/packages/ui/src/components/EvidenceViewer.tsx +718 -0
  25. package/packages/ui/src/components/EvolutionTimeline.tsx +252 -0
  26. package/packages/ui/src/components/InfoTip.tsx +19 -0
  27. package/packages/ui/src/components/OrchestrateRunsPanel.tsx +164 -0
  28. package/packages/ui/src/components/index.ts +7 -0
  29. package/packages/ui/src/components/section-cards.tsx +155 -0
  30. package/packages/ui/src/components/skill-health-grid.tsx +686 -0
  31. package/packages/ui/src/lib/constants.tsx +43 -0
  32. package/packages/ui/src/lib/format.ts +37 -0
  33. package/packages/ui/src/lib/index.ts +3 -0
  34. package/packages/ui/src/lib/utils.ts +6 -0
  35. package/packages/ui/src/primitives/badge.tsx +52 -0
  36. package/packages/ui/src/primitives/button.tsx +58 -0
  37. package/packages/ui/src/primitives/card.tsx +103 -0
  38. package/packages/ui/src/primitives/checkbox.tsx +27 -0
  39. package/packages/ui/src/primitives/collapsible.tsx +7 -0
  40. package/packages/ui/src/primitives/dropdown-menu.tsx +266 -0
  41. package/packages/ui/src/primitives/index.ts +55 -0
  42. package/packages/ui/src/primitives/label.tsx +20 -0
  43. package/packages/ui/src/primitives/select.tsx +197 -0
  44. package/packages/ui/src/primitives/table.tsx +114 -0
  45. package/packages/ui/src/primitives/tabs.tsx +82 -0
  46. package/packages/ui/src/primitives/tooltip.tsx +64 -0
  47. package/packages/ui/src/types.ts +87 -0
  48. package/packages/ui/tsconfig.json +17 -0
  49. package/skill/SKILL.md +3 -0
  50. package/skill/Workflows/Telemetry.md +59 -0
  51. package/apps/local-dashboard/dist/assets/index-C4EOTFZ2.js +0 -15
  52. package/apps/local-dashboard/dist/assets/index-bl-Webyd.css +0 -1
  53. package/apps/local-dashboard/dist/assets/vendor-ui-D7_zX_qy.js +0 -346
@@ -0,0 +1,15 @@
1
+ var Ms=e=>{throw TypeError(e)};var ur=(e,t,n)=>t.has(e)||Ms("Cannot "+n);var g=(e,t,n)=>(ur(e,t,"read from private field"),n?n.call(e):t.get(e)),H=(e,t,n)=>t.has(e)?Ms("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),A=(e,t,n,r)=>(ur(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),G=(e,t,n)=>(ur(e,t,"access private method"),n);var Dn=(e,t,n,r)=>({set _(i){A(e,t,i,n)},get _(){return g(e,t,r)}});import{r as M,j as s,u as Sl,L as qt,g as ia,d as Cl,B as El,e as Il,f as dr,h as Tl}from"./vendor-react-U7zYD9Rg.js";import{t as zl,c as Pl,u as Xn,m as Jn,a as Zn,B as _l,C as Al,b as Rl,d as er,e as Ol,f as Ml,g as Dl,M as Ll,h as Fl,i as Bl,j as Ul,k as Hl,l as ql,n as $l,o as Vl,p as Ql,q as Kl,S as Gl,r as Wl,s as Yl,v as Rt,w as Xl,x as Jl,y as Zl,z as eo,A as to,D as no,E as ro,F as so,G as io,H as ao,I as lo,J as oo,T as co,K as uo,L as ho,N as fo,O as po,P as mo,Q as xo,R as go,U as yo,V as bo,W as vo,X as ss,Y as gt,Z as Ue,_ as Ot,$ as nt,a0 as jo,a1 as wo,a2 as No,a3 as ko,a4 as So,a5 as aa,a6 as Co,a7 as Eo,a8 as Io,a9 as To,aa as zo,ab as Po,ac as la,ad as sn,ae as an,af as Hn,ag as _o,ah as Ao,ai as Ro,aj as Oo,ak as is,al as oa,am as ca,an as Mo,ao as tr,ap as nr,aq as ua,ar as Qn,as,at as da,au as gn,av as Do,aw as Ds,ax as Lo,ay as ls,az as Fo,aA as rr,aB as ha,aC as Bo,aD as Uo,aE as Ho,aF as qo,aG as $o,aH as Vo,aI as sr,aJ as Kn,aK as Qo,aL as Ko,aM as Go,aN as Wo,aO as Yo,aP as Xo,aQ as Jo,aR as Zo,aS as ec,aT as tc}from"./vendor-ui-r2k_Ku_V.js";import{u as nc,a as hr,b as rc,D as sc,r as ic,c as ac,f as fa,S as lc,v as oc,g as cc,d as uc,e as dc,h as hc,i as fc,j as pc,s as mc,K as xc,T as gc,M as yc,k as bc,l as vc,C as jc}from"./vendor-table-B7VF2Ipl.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)}})();var An=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(){}},wc={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},at,rs,Wi,Nc=(Wi=class{constructor(){H(this,at,wc);H(this,rs,!1)}setTimeoutProvider(e){A(this,at,e)}setTimeout(e,t){return g(this,at).setTimeout(e,t)}clearTimeout(e){g(this,at).clearTimeout(e)}setInterval(e,t){return g(this,at).setInterval(e,t)}clearInterval(e){g(this,at).clearInterval(e)}},at=new WeakMap,rs=new WeakMap,Wi),kt=new Nc;function kc(e){setTimeout(e,0)}var Mt=typeof window>"u"||"Deno"in globalThis;function Ne(){}function Sc(e,t){return typeof e=="function"?e(t):e}function Tr(e){return typeof e=="number"&&e>=0&&e!==1/0}function pa(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 Ls(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==os(l,t.options))return!1}else if(!Cn(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 Fs(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Sn(t.options.mutationKey)!==Sn(a))return!1}else if(!Cn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function os(e,t){return((t==null?void 0:t.queryKeyHashFn)||Sn)(e)}function Sn(e){return JSON.stringify(e,(t,n)=>Pr(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Cn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Cn(e[n],t[n])):!1}var Cc=Object.prototype.hasOwnProperty;function ma(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Bs(e)&&Bs(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:Cc.call(e,h))&&u++;continue}if(p===null||f===null||typeof p!="object"||typeof f!="object"){c[h]=f;continue}const b=ma(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 Bs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pr(e){if(!Us(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Us(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Us(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ec(e){return new Promise(t=>{kt.setTimeout(t,e)})}function _r(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ma(e,t):t}function Ic(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Tc(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cs=Symbol();function xa(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===cs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ga(e,t){return typeof e=="function"?e(...t):!!e}function zc(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 St,lt,Qt,Yi,Pc=(Yi=class extends An{constructor(){super();H(this,St);H(this,lt);H(this,Qt);A(this,Qt,t=>{if(!Mt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,lt)||this.setEventListener(g(this,Qt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,lt))==null||t.call(this),A(this,lt,void 0))}setEventListener(t){var n;A(this,Qt,t),(n=g(this,lt))==null||n.call(this),A(this,lt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,St)!==t&&(A(this,St,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,St)=="boolean"?g(this,St):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},St=new WeakMap,lt=new WeakMap,Qt=new WeakMap,Yi),us=new Pc;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 _c=kc;function Ac(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=_c;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 fe=Ac(),Kt,ot,Gt,Xi,Rc=(Xi=class extends An{constructor(){super();H(this,Kt,!0);H(this,ot);H(this,Gt);A(this,Gt,t=>{if(!Mt&&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,ot)||this.setEventListener(g(this,Gt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,ot))==null||t.call(this),A(this,ot,void 0))}setEventListener(t){var n;A(this,Gt,t),(n=g(this,ot))==null||n.call(this),A(this,ot,t(this.setOnline.bind(this)))}setOnline(t){g(this,Kt)!==t&&(A(this,Kt,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,Kt)}},Kt=new WeakMap,ot=new WeakMap,Gt=new WeakMap,Xi),Gn=new Rc;function Oc(e){return Math.min(1e3*2**e,3e4)}function ya(e){return(e??"online")==="online"?Gn.isOnline():!0}var Rr=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ba(e){let t=!1,n=0,r;const i=Ar(),a=()=>i.status!=="pending",l=w=>{var v;if(!a()){const y=new Rr(w);p(y),(v=e.onCancel)==null||v.call(e,y)}},o=()=>{t=!0},c=()=>{t=!1},u=()=>us.isFocused()&&(e.networkMode==="always"||Gn.isOnline())&&e.canRun(),d=()=>ya(e.networkMode)&&e.canRun(),h=w=>{a()||(r==null||r(),i.resolve(w))},p=w=>{a()||(r==null||r(),i.reject(w))},f=()=>new Promise(w=>{var v;r=y=>{(a()||u())&&w(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(a())return;let w;const v=n===0?e.initialPromise:void 0;try{w=v??e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(h).catch(y=>{var N;if(a())return;const C=e.retry??(Mt?0:3),E=e.retryDelay??Oc,I=typeof E=="function"?E(n,y):E,F=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,y);if(t||!F){p(y);return}n++,(N=e.onFail)==null||N.call(e,n,y),Ec(I).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 Ct,Ji,va=(Ji=class{constructor(){H(this,Ct)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tr(this.gcTime)&&A(this,Ct,kt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Mt?1/0:300*1e3))}clearGcTimeout(){g(this,Ct)&&(kt.clearTimeout(g(this,Ct)),A(this,Ct,void 0))}},Ct=new WeakMap,Ji),Et,Wt,Te,It,de,In,Tt,Le,Je,Zi,Mc=(Zi=class extends va{constructor(t){super();H(this,Le);H(this,Et);H(this,Wt);H(this,Te);H(this,It);H(this,de);H(this,In);H(this,Tt);A(this,Tt,!1),A(this,In,t.defaultOptions),this.setOptions(t.options),this.observers=[],A(this,It,t.client),A(this,Te,g(this,It).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,A(this,Et,qs(this.options)),this.state=t.state??g(this,Et),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=g(this,de))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,In),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=qs(this.options);n.data!==void 0&&(this.setState(Hs(n.data,n.dataUpdatedAt)),A(this,Et,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Te).remove(this)}setData(t,n){const r=_r(this.state.data,t,this.options);return G(this,Le,Je).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,Le,Je).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=g(this,de))==null?void 0:r.promise;return(i=g(this,de))==null||i.cancel(t),n?n.then(Ne).catch(Ne):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(g(this,Et))}isActive(){return this.observers.some(t=>ze(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cs||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:!pa(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,de))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,de))==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,de)&&(g(this,Tt)?g(this,de).cancel({revert:!0}):g(this,de).cancelRetry()),this.scheduleGc()),g(this,Te).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||G(this,Le,Je).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,d,h,p,f,b,w,v,y,C,E;if(this.state.fetchStatus!=="idle"&&((c=g(this,de))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,de))return g(this,de).continueRetry(),g(this,de).promise}if(t&&this.setOptions(t),!this.options.queryFn){const I=this.observers.find(F=>F.options.queryFn);I&&this.setOptions(I.options)}const r=new AbortController,i=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(A(this,Tt,!0),r.signal)})},a=()=>{const I=xa(this.options,n),N=(()=>{const R={client:g(this,It),queryKey:this.queryKey,meta:this.meta};return i(R),R})();return A(this,Tt,!1),this.options.persister?this.options.persister(I,N,this):I(N)},o=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,It),state:this.state,fetchFn:a};return i(I),I})();(u=this.options.behavior)==null||u.onFetch(o,this),A(this,Wt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&G(this,Le,Je).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta}),A(this,de,ba({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:I=>{I instanceof Rr&&I.revert&&this.setState({...g(this,Wt),fetchStatus:"idle"}),r.abort()},onFail:(I,F)=>{G(this,Le,Je).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{G(this,Le,Je).call(this,{type:"pause"})},onContinue:()=>{G(this,Le,Je).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const I=await g(this,de).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(f=(p=g(this,Te).config).onSuccess)==null||f.call(p,I,this),(w=(b=g(this,Te).config).onSettled)==null||w.call(b,I,this.state.error,this),I}catch(I){if(I instanceof Rr){if(I.silent)return g(this,de).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw G(this,Le,Je).call(this,{type:"error",error:I}),(y=(v=g(this,Te).config).onError)==null||y.call(v,I,this),(E=(C=g(this,Te).config).onSettled)==null||E.call(C,this.state.data,I,this),I}finally{this.scheduleGc()}}},Et=new WeakMap,Wt=new WeakMap,Te=new WeakMap,It=new WeakMap,de=new WeakMap,In=new WeakMap,Tt=new WeakMap,Le=new WeakSet,Je=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,...ja(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...Hs(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return A(this,Wt,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),fe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,Te).notify({query:this,type:"updated",action:t})})},Zi);function ja(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ya(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Hs(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qs(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 we,W,Tn,xe,zt,Yt,Ze,ct,zn,Xt,Jt,Pt,_t,ut,Zt,J,yn,Or,Mr,Dr,Lr,Fr,Br,Ur,wa,ea,Dc=(ea=class extends An{constructor(t,n){super();H(this,J);H(this,we);H(this,W);H(this,Tn);H(this,xe);H(this,zt);H(this,Yt);H(this,Ze);H(this,ct);H(this,zn);H(this,Xt);H(this,Jt);H(this,Pt);H(this,_t);H(this,ut);H(this,Zt,new Set);this.options=n,A(this,we,t),A(this,ct,null),A(this,Ze,Ar()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,W).addObserver(this),$s(g(this,W),this.options)?G(this,J,yn).call(this):this.updateResult(),G(this,J,Lr).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Hr(g(this,W),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Hr(g(this,W),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,G(this,J,Fr).call(this),G(this,J,Br).call(this),g(this,W).removeObserver(this)}setOptions(t){const n=this.options,r=g(this,W);if(this.options=g(this,we).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ze(this.options.enabled,g(this,W))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");G(this,J,Ur).call(this),g(this,W).setOptions(this.options),n._defaulted&&!zr(this.options,n)&&g(this,we).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,W),observer:this});const i=this.hasListeners();i&&Vs(g(this,W),r,this.options,n)&&G(this,J,yn).call(this),this.updateResult(),i&&(g(this,W)!==r||ze(this.options.enabled,g(this,W))!==ze(n.enabled,g(this,W))||mt(this.options.staleTime,g(this,W))!==mt(n.staleTime,g(this,W)))&&G(this,J,Or).call(this);const a=G(this,J,Mr).call(this);i&&(g(this,W)!==r||ze(this.options.enabled,g(this,W))!==ze(n.enabled,g(this,W))||a!==g(this,ut))&&G(this,J,Dr).call(this,a)}getOptimisticResult(t){const n=g(this,we).getQueryCache().build(g(this,we),t),r=this.createResult(n,t);return Fc(this,r)&&(A(this,xe,r),A(this,Yt,this.options),A(this,zt,g(this,W).state)),r}getCurrentResult(){return g(this,xe)}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,Ze).status==="pending"&&g(this,Ze).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){g(this,Zt).add(t)}getCurrentQuery(){return g(this,W)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=g(this,we).defaultQueryOptions(t),r=g(this,we).getQueryCache().build(g(this,we),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return G(this,J,yn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,xe)))}createResult(t,n){var B;const r=g(this,W),i=this.options,a=g(this,xe),l=g(this,zt),o=g(this,Yt),u=t!==r?t.state:g(this,Tn),{state:d}=t;let h={...d},p=!1,f;if(n._optimisticResults){const q=this.hasListeners(),O=!q&&$s(t,n),k=q&&Vs(t,r,n,i);(O||k)&&(h={...h,...ja(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:v}=h;f=h.data;let y=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let q;a!=null&&a.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(q=a.data,y=!0):q=typeof n.placeholderData=="function"?n.placeholderData((B=g(this,Jt))==null?void 0:B.state.data,g(this,Jt)):n.placeholderData,q!==void 0&&(v="success",f=_r(a==null?void 0:a.data,q,n),p=!0)}if(n.select&&f!==void 0&&!y)if(a&&f===(l==null?void 0:l.data)&&n.select===g(this,zn))f=g(this,Xt);else try{A(this,zn,n.select),f=n.select(f),f=_r(a==null?void 0:a.data,f,n),A(this,Xt,f),A(this,ct,null)}catch(q){A(this,ct,q)}g(this,ct)&&(b=g(this,ct),f=g(this,Xt),w=Date.now(),v="error");const C=h.fetchStatus==="fetching",E=v==="pending",I=v==="error",F=E&&C,N=f!==void 0,L={status:v,fetchStatus:h.fetchStatus,isPending:E,isSuccess:v==="success",isError:I,isInitialLoading:F,isLoading:F,data:f,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:I&&!N,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:I&&N,isStale:ds(t,n),refetch:this.refetch,promise:g(this,Ze),isEnabled:ze(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=L.data!==void 0,O=L.status==="error"&&!q,k=z=>{O?z.reject(L.error):q&&z.resolve(L.data)},j=()=>{const z=A(this,Ze,L.promise=Ar());k(z)},_=g(this,Ze);switch(_.status){case"pending":t.queryHash===r.queryHash&&k(_);break;case"fulfilled":(O||L.data!==_.value)&&j();break;case"rejected":(!O||L.error!==_.reason)&&j();break}}return L}updateResult(){const t=g(this,xe),n=this.createResult(g(this,W),this.options);if(A(this,zt,g(this,W).state),A(this,Yt,this.options),g(this,zt).data!==void 0&&A(this,Jt,g(this,W)),zr(n,t))return;A(this,xe,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!g(this,Zt).size)return!0;const l=new Set(a??g(this,Zt));return this.options.throwOnError&&l.add("error"),Object.keys(g(this,xe)).some(o=>{const c=o;return g(this,xe)[c]!==t[c]&&l.has(c)})};G(this,J,wa).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&G(this,J,Lr).call(this)}},we=new WeakMap,W=new WeakMap,Tn=new WeakMap,xe=new WeakMap,zt=new WeakMap,Yt=new WeakMap,Ze=new WeakMap,ct=new WeakMap,zn=new WeakMap,Xt=new WeakMap,Jt=new WeakMap,Pt=new WeakMap,_t=new WeakMap,ut=new WeakMap,Zt=new WeakMap,J=new WeakSet,yn=function(t){G(this,J,Ur).call(this);let n=g(this,W).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ne)),n},Or=function(){G(this,J,Fr).call(this);const t=mt(this.options.staleTime,g(this,W));if(Mt||g(this,xe).isStale||!Tr(t))return;const r=pa(g(this,xe).dataUpdatedAt,t)+1;A(this,Pt,kt.setTimeout(()=>{g(this,xe).isStale||this.updateResult()},r))},Mr=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,W)):this.options.refetchInterval)??!1},Dr=function(t){G(this,J,Br).call(this),A(this,ut,t),!(Mt||ze(this.options.enabled,g(this,W))===!1||!Tr(g(this,ut))||g(this,ut)===0)&&A(this,_t,kt.setInterval(()=>{(this.options.refetchIntervalInBackground||us.isFocused())&&G(this,J,yn).call(this)},g(this,ut)))},Lr=function(){G(this,J,Or).call(this),G(this,J,Dr).call(this,G(this,J,Mr).call(this))},Fr=function(){g(this,Pt)&&(kt.clearTimeout(g(this,Pt)),A(this,Pt,void 0))},Br=function(){g(this,_t)&&(kt.clearInterval(g(this,_t)),A(this,_t,void 0))},Ur=function(){const t=g(this,we).getQueryCache().build(g(this,we),this.options);if(t===g(this,W))return;const n=g(this,W);A(this,W,t),A(this,Tn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},wa=function(t){fe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,xe))}),g(this,we).getQueryCache().notify({query:g(this,W),type:"observerResultsUpdated"})})},ea);function Lc(e,t){return ze(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $s(e,t){return Lc(e,t)||e.state.data!==void 0&&Hr(e,t,t.refetchOnMount)}function Hr(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&&ds(e,t)}return!1}function Vs(e,t,n,r){return(e!==t||ze(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ds(e,n)}function ds(e,t){return ze(t.enabled,e)!==!1&&e.isStaleByTime(mt(t.staleTime,e))}function Fc(e,t){return!zr(e.getCurrentResult(),t)}function Qs(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 w=!1;const v=E=>{zc(E,()=>t.signal,()=>w=!0)},y=xa(t.options,t.fetchOptions),C=async(E,I,F)=>{if(w)return Promise.reject();if(I==null&&E.pages.length)return Promise.resolve(E);const R=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:I,direction:F?"backward":"forward",meta:t.options.meta};return v(O),O})(),L=await y(R),{maxPages:B}=t.options,q=F?Tc:Ic;return{pages:q(E.pages,L,B),pageParams:q(E.pageParams,I,B)}};if(i&&a.length){const E=i==="backward",I=E?Bc:Ks,F={pages:a,pageParams:l},N=I(r,F);o=await C(F,N,E)}else{const E=e??a.length;do{const I=c===0?l[0]??r.initialPageParam:Ks(r,o);if(c>0&&I==null)break;o=await C(o,I),c++}while(c<E)}return o};t.options.persister?t.fetchFn=()=>{var w,v;return(v=(w=t.options).persister)==null?void 0:v.call(w,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Ks(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 Bc(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 Pn,qe,pe,At,$e,it,ta,Uc=(ta=class extends va{constructor(t){super();H(this,$e);H(this,Pn);H(this,qe);H(this,pe);H(this,At);A(this,Pn,t.client),this.mutationId=t.mutationId,A(this,pe,t.mutationCache),A(this,qe,[]),this.state=t.state||Hc(),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,qe).includes(t)||(g(this,qe).push(t),this.clearGcTimeout(),g(this,pe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){A(this,qe,g(this,qe).filter(n=>n!==t)),this.scheduleGc(),g(this,pe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,qe).length||(this.state.status==="pending"?this.scheduleGc():g(this,pe).remove(this))}continue(){var t;return((t=g(this,At))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,c,u,d,h,p,f,b,w,v,y,C,E,I,F,N,R;const n=()=>{G(this,$e,it).call(this,{type:"continue"})},r={client:g(this,Pn),meta:this.options.meta,mutationKey:this.options.mutationKey};A(this,At,ba({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,B)=>{G(this,$e,it).call(this,{type:"failed",failureCount:L,error:B})},onPause:()=>{G(this,$e,it).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,pe).canRun(this)}));const i=this.state.status==="pending",a=!g(this,At).canStart();try{if(i)n();else{G(this,$e,it).call(this,{type:"pending",variables:t,isPaused:a}),g(this,pe).config.onMutate&&await g(this,pe).config.onMutate(t,this,r);const B=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));B!==this.state.context&&G(this,$e,it).call(this,{type:"pending",context:B,variables:t,isPaused:a})}const L=await g(this,At).start();return await((u=(c=g(this,pe).config).onSuccess)==null?void 0:u.call(c,L,t,this.state.context,this,r)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,L,t,this.state.context,r)),await((f=(p=g(this,pe).config).onSettled)==null?void 0:f.call(p,L,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,L,null,t,this.state.context,r)),G(this,$e,it).call(this,{type:"success",data:L}),L}catch(L){try{await((y=(v=g(this,pe).config).onError)==null?void 0:y.call(v,L,t,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((E=(C=this.options).onError)==null?void 0:E.call(C,L,t,this.state.context,r))}catch(B){Promise.reject(B)}try{await((F=(I=g(this,pe).config).onSettled)==null?void 0:F.call(I,void 0,L,this.state.variables,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((R=(N=this.options).onSettled)==null?void 0:R.call(N,void 0,L,t,this.state.context,r))}catch(B){Promise.reject(B)}throw G(this,$e,it).call(this,{type:"error",error:L}),L}finally{g(this,pe).runNext(this)}}},Pn=new WeakMap,qe=new WeakMap,pe=new WeakMap,At=new WeakMap,$e=new WeakSet,it=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),fe.batch(()=>{g(this,qe).forEach(r=>{r.onMutationUpdate(t)}),g(this,pe).notify({mutation:this,type:"updated",action:t})})},ta);function Hc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var et,Fe,_n,na,qc=(na=class extends An{constructor(t={}){super();H(this,et);H(this,Fe);H(this,_n);this.config=t,A(this,et,new Set),A(this,Fe,new Map),A(this,_n,0)}build(t,n,r){const i=new Uc({client:t,mutationCache:this,mutationId:++Dn(this,_n)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){g(this,et).add(t);const n=Ln(t);if(typeof n=="string"){const r=g(this,Fe).get(n);r?r.push(t):g(this,Fe).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(g(this,et).delete(t)){const n=Ln(t);if(typeof n=="string"){const r=g(this,Fe).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,Fe).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ln(t);if(typeof n=="string"){const r=g(this,Fe).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,Fe).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(){fe.batch(()=>{g(this,et).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,et).clear(),g(this,Fe).clear()})}getAll(){return Array.from(g(this,et))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fs(n,r))}findAll(t={}){return this.getAll().filter(n=>Fs(t,n))}notify(t){fe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return fe.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ne))))}},et=new WeakMap,Fe=new WeakMap,_n=new WeakMap,na);function Ln(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ve,ra,$c=(ra=class extends An{constructor(t={}){super();H(this,Ve);this.config=t,A(this,Ve,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??os(i,n);let l=this.get(a);return l||(l=new Mc({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){g(this,Ve).has(t.queryHash)||(g(this,Ve).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=g(this,Ve).get(t.queryHash);n&&(t.destroy(),n===t&&g(this,Ve).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){fe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return g(this,Ve).get(t)}getAll(){return[...g(this,Ve).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ls(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ls(t,r)):n}notify(t){fe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){fe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){fe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ve=new WeakMap,ra),le,dt,ht,en,tn,ft,nn,rn,sa,Vc=(sa=class{constructor(e={}){H(this,le);H(this,dt);H(this,ht);H(this,en);H(this,tn);H(this,ft);H(this,nn);H(this,rn);A(this,le,e.queryCache||new $c),A(this,dt,e.mutationCache||new qc),A(this,ht,e.defaultOptions||{}),A(this,en,new Map),A(this,tn,new Map),A(this,ft,0)}mount(){Dn(this,ft)._++,g(this,ft)===1&&(A(this,nn,us.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,le).onFocus())})),A(this,rn,Gn.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,le).onOnline())})))}unmount(){var e,t;Dn(this,ft)._--,g(this,ft)===0&&((e=g(this,nn))==null||e.call(this),A(this,nn,void 0),(t=g(this,rn))==null||t.call(this),A(this,rn,void 0))}isFetching(e){return g(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,dt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,le).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,le).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,le).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,le).get(r.queryHash),a=i==null?void 0:i.state.data,l=Sc(t,a);if(l!==void 0)return g(this,le).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return fe.batch(()=>g(this,le).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,le).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,le);fe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,le);return fe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=fe.batch(()=>g(this,le).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ne).catch(Ne)}invalidateQueries(e,t={}){return fe.batch(()=>(g(this,le).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=fe.batch(()=>g(this,le).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Ne)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Ne)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=g(this,le).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(Ne).catch(Ne)}fetchInfiniteQuery(e){return e.behavior=Qs(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ne).catch(Ne)}ensureInfiniteQueryData(e){return e.behavior=Qs(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gn.isOnline()?g(this,dt).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,le)}getMutationCache(){return g(this,dt)}getDefaultOptions(){return g(this,ht)}setDefaultOptions(e){A(this,ht,e)}setQueryDefaults(e,t){g(this,en).set(Sn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,en).values()],n={};return t.forEach(r=>{Cn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,tn).set(Sn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,tn).values()],n={};return t.forEach(r=>{Cn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...g(this,ht).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=os(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===cs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,ht).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,le).clear(),g(this,dt).clear()}},le=new WeakMap,dt=new WeakMap,ht=new WeakMap,en=new WeakMap,tn=new WeakMap,ft=new WeakMap,nn=new WeakMap,rn=new WeakMap,sa),Na=M.createContext(void 0),Qc=e=>{const t=M.useContext(Na);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Kc=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(Na.Provider,{value:e,children:t})),ka=M.createContext(!1),Gc=()=>M.useContext(ka);ka.Provider;function Wc(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Yc=M.createContext(Wc()),Xc=()=>M.useContext(Yc),Jc=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ga(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Zc=e=>{M.useEffect(()=>{e.clearReset()},[e])},eu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ga(n,[e.error,r])),tu=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))}},nu=(e,t)=>e.isLoading&&e.isFetching&&!t,ru=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Gs=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function su(e,t,n){var p,f,b,w;const r=Gc(),i=Xc(),a=Qc(),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",tu(l),Jc(l,i,o),Zc(i);const c=!a.getQueryCache().get(l.queryHash),[u]=M.useState(()=>new t(a,l)),d=u.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(v=>{const y=h?u.subscribe(fe.batchCalls(v)):Ne;return u.updateResult(),y},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),M.useEffect(()=>{u.setOptions(l)},[l,u]),ru(l,d))throw Gs(l,u,i);if(eu({result:d,errorResetBoundary:i,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw d.error;if((w=(b=a.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,l,d),l.experimental_prefetchInRender&&!Mt&&nu(d,r)){const v=c?Gs(l,u,i):o==null?void 0:o.promise;v==null||v.catch(Ne).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?d:u.trackResult(d)}function ir(e,t){return su(e,Dc)}function D(...e){return zl(Pl(e))}const iu=Zn("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 U({className:e,variant:t="default",render:n,...r}){return Xn({defaultTagName:"span",props:Jn({className:D(iu({variant:t}),e)},r),render:n,state:{slot:"badge",variant:t}})}const au=Zn("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(_l,{"data-slot":"button",className:D(au({variant:t,size:n,className:e})),...r})}function Z({className:e,size:t="default",...n}){return s.jsx("div",{"data-slot":"card","data-size":t,className:D("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 ee({className:e,...t}){return s.jsx("div",{"data-slot":"card-header",className:D("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 te({className:e,...t}){return s.jsx("div",{"data-slot":"card-title",className:D("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function ie({className:e,...t}){return s.jsx("div",{"data-slot":"card-description",className:D("text-sm text-muted-foreground",e),...t})}function pt({className:e,...t}){return s.jsx("div",{"data-slot":"card-action",className:D("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function Be({className:e,...t}){return s.jsx("div",{"data-slot":"card-content",className:D("px-4 group-data-[size=sm]/card:px-3",e),...t})}function Ws({className:e,...t}){return s.jsx(Al,{"data-slot":"checkbox",className:D("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(Rl,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:s.jsx(er,{})})})}const Sa=Ol,Ca=Ml,Ea=Dl;function Ys({...e}){return s.jsx(Ll,{"data-slot":"dropdown-menu",...e})}function Xs({...e}){return s.jsx(Fl,{"data-slot":"dropdown-menu-trigger",...e})}function Js({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...a}){return s.jsx(Bl,{children:s.jsx(Ul,{className:"isolate z-50 outline-hidden",align:e,alignOffset:t,side:n,sideOffset:r,children:s.jsx(Hl,{"data-slot":"dropdown-menu-content",className:D("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 lu({className:e,children:t,checked:n,inset:r,...i}){return s.jsxs(Ql,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:D("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(Kl,{children:s.jsx(er,{})})}),t]})}function ou({...e}){return s.jsx(ql,{"data-slot":"dropdown-menu-radio-group",...e})}function cu({className:e,children:t,inset:n,...r}){return s.jsxs($l,{"data-slot":"dropdown-menu-radio-item","data-inset":n,className:D("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(Vl,{children:s.jsx(er,{})})}),t]})}function Zs({className:e,...t}){return s.jsx("label",{"data-slot":"label",className:D("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 ei=Gl;function ti({className:e,...t}){return s.jsx(no,{"data-slot":"select-group",className:D("scroll-my-1 p-1",e),...t})}function ni({className:e,...t}){return s.jsx(Xl,{"data-slot":"select-value",className:D("flex flex-1 text-left",e),...t})}function ri({className:e,size:t="default",children:n,...r}){return s.jsxs(Wl,{"data-slot":"select-trigger","data-size":t,className:D("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(Yl,{render:s.jsx(Rt,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function si({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:a=0,alignItemWithTrigger:l=!0,...o}){return s.jsx(Jl,{children:s.jsx(Zl,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:l,className:"isolate z-50",children:s.jsxs(eo,{"data-slot":"select-content","data-align-trigger":l,className:D("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(uu,{}),s.jsx(to,{children:t}),s.jsx(du,{})]})})})}function hn({className:e,children:t,...n}){return s.jsxs(ro,{"data-slot":"select-item",className:D("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(so,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),s.jsx(io,{render:s.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:s.jsx(er,{className:"pointer-events-none"})})]})}function uu({className:e,...t}){return s.jsx(ao,{"data-slot":"select-scroll-up-button",className:D("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(lo,{})})}function du({className:e,...t}){return s.jsx(oo,{"data-slot":"select-scroll-down-button",className:D("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(Rt,{})})}function bn({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:D("w-full caption-bottom text-sm",e),...t})})}function vn({className:e,...t}){return s.jsx("thead",{"data-slot":"table-header",className:D("[&_tr]:border-b",e),...t})}function jn({className:e,...t}){return s.jsx("tbody",{"data-slot":"table-body",className:D("[&_tr:last-child]:border-0",e),...t})}function De({className:e,...t}){return s.jsx("tr",{"data-slot":"table-row",className:D("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function ce({className:e,...t}){return s.jsx("th",{"data-slot":"table-head",className:D("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...t})}function oe({className:e,...t}){return s.jsx("td",{"data-slot":"table-cell",className:D("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}function hs({className:e,orientation:t="horizontal",...n}){return s.jsx(co,{"data-slot":"tabs","data-orientation":t,className:D("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})}const hu=Zn("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 fs({className:e,variant:t="default",...n}){return s.jsx(uo,{"data-slot":"tabs-list","data-variant":t,className:D(hu({variant:t}),e),...n})}function _e({className:e,...t}){return s.jsx(ho,{"data-slot":"tabs-trigger",className:D("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 tt({className:e,...t}){return s.jsx(fo,{"data-slot":"tabs-content",className:D("flex-1 text-sm outline-none",e),...t})}function fu({delay:e=0,...t}){return s.jsx(po,{"data-slot":"tooltip-provider",delay:e,...t})}function jt({...e}){return s.jsx(mo,{"data-slot":"tooltip",...e})}function wt({...e}){return s.jsx(vo,{"data-slot":"tooltip-trigger",...e})}function Nt({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:a,...l}){return s.jsx(xo,{children:s.jsx(go,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:s.jsxs(yo,{"data-slot":"tooltip-content",className:D("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(bo,{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"})]})})})}const qr={HEALTHY:{icon:s.jsx(nt,{className:"size-4 text-emerald-600"}),variant:"outline",label:"Healthy"},WARNING:{icon:s.jsx(Ot,{className:"size-4 text-amber-500"}),variant:"secondary",label:"Warning"},CRITICAL:{icon:s.jsx(Ue,{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(ss,{className:"size-4 text-muted-foreground/60"}),variant:"secondary",label:"Unknown"}};function ps(e,t){return t<5?"UNGRADED":e>=.8?"HEALTHY":e>=.5?"WARNING":"CRITICAL"}function xt(e){return e==null||!Number.isFinite(e)?"--":`${Math.round(e*100)}%`}function Ia(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 be(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 pu({className:e,type:t,...n}){return s.jsx(jo,{type:t,"data-slot":"input",className:D("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})}const fr=768;function mu(){const[e,t]=M.useState(void 0);return M.useEffect(()=>{const n=window.matchMedia(`(max-width: ${fr-1}px)`),r=()=>{t(window.innerWidth<fr)};return n.addEventListener("change",r),t(window.innerWidth<fr),()=>n.removeEventListener("change",r)},[]),!!e}function xu({className:e,orientation:t="horizontal",...n}){return s.jsx(wo,{"data-slot":"separator",orientation:t,className:D("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}function gu({...e}){return s.jsx(No,{"data-slot":"sheet",...e})}function yu({...e}){return s.jsx(Io,{"data-slot":"sheet-portal",...e})}function bu({className:e,...t}){return s.jsx(To,{"data-slot":"sheet-overlay",className:D("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 vu({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return s.jsxs(yu,{children:[s.jsx(bu,{}),s.jsxs(ko,{"data-slot":"sheet-content","data-side":n,className:D("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(So,{"data-slot":"sheet-close",render:s.jsx(ye,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[s.jsx(aa,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ju({className:e,...t}){return s.jsx("div",{"data-slot":"sheet-header",className:D("flex flex-col gap-0.5 p-4",e),...t})}function wu({className:e,...t}){return s.jsx(Co,{"data-slot":"sheet-title",className:D("text-base font-medium text-foreground",e),...t})}function Nu({className:e,...t}){return s.jsx(Eo,{"data-slot":"sheet-description",className:D("text-sm text-muted-foreground",e),...t})}function Ke({className:e,...t}){return s.jsx("div",{"data-slot":"skeleton",className:D("animate-pulse rounded-md bg-muted",e),...t})}const ku="sidebar_state",Su=3600*24*7,Cu="16rem",Eu="18rem",Iu="3rem",Tu="b",Ta=M.createContext(null);function ms(){const e=M.useContext(Ta);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function zu({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...l}){const o=mu(),[c,u]=M.useState(!1),[d,h]=M.useState(e),p=t??d,f=M.useCallback(y=>{const C=typeof y=="function"?y(p):y;n?n(C):h(C),document.cookie=`${ku}=${C}; path=/; max-age=${Su}`},[n,p]),b=M.useCallback(()=>o?u(y=>!y):f(y=>!y),[o,f,u]);M.useEffect(()=>{const y=C=>{C.key===Tu&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const w=p?"expanded":"collapsed",v=M.useMemo(()=>({state:w,open:p,setOpen:f,isMobile:o,openMobile:c,setOpenMobile:u,toggleSidebar:b}),[w,p,f,o,c,u,b]);return s.jsx(Ta.Provider,{value:v,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Cu,"--sidebar-width-icon":Iu,...i},className:D("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...l,children:a})})}function Pu({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}=ms();return n==="none"?s.jsx("div",{"data-slot":"sidebar",className:D("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...l,children:i}):o?s.jsx(gu,{open:u,onOpenChange:d,...l,children:s.jsxs(vu,{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":Eu},side:e,children:[s.jsxs(ju,{className:"sr-only",children:[s.jsx(wu,{children:"Sidebar"}),s.jsx(Nu,{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:D("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:D("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 _u({className:e,onClick:t,...n}){const{toggleSidebar:r}=ms();return s.jsxs(ye,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:D(e),onClick:i=>{t==null||t(i),r()},...n,children:[s.jsx(zo,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Au({className:e,...t}){return s.jsx("main",{"data-slot":"sidebar-inset",className:D("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 Ru({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:D("flex flex-col gap-2 p-2",e),...t})}function Ou({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:D("flex flex-col gap-2 p-2",e),...t})}function Mu({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:D("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function ii({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:D("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Du({className:e,render:t,...n}){return Xn({defaultTagName:"div",props:Jn({className:D("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 ai({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:D("w-full text-sm",e),...t})}function pr({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:D("flex w-full min-w-0 flex-col gap-0",e),...t})}function qn({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:D("group/menu-item relative",e),...t})}const Lu=Zn("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 [&_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 $n({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:a,...l}){const{isMobile:o,state:c}=ms(),u=Xn({defaultTagName:"button",props:Jn({className:D(Lu({variant:n,size:r}),a)},l),render:i?s.jsx(wt,{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(jt,{children:[u,s.jsx(Nt,{side:"right",align:"center",hidden:c!=="collapsed"||o,...i})]})):u}function Fu({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:D("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 Bu({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:D("group/menu-sub-item relative",e),...t})}function Uu({render:e,size:t="md",isActive:n=!1,className:r,...i}){return Xn({defaultTagName:"a",props:Jn({className:D("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:text-sidebar-accent-foreground [&>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 za={HEALTHY:s.jsx(nt,{className:"size-3.5 text-emerald-600"}),WARNING:s.jsx(Ot,{className:"size-3.5 text-amber-500"}),CRITICAL:s.jsx(Ue,{className:"size-3.5 text-red-500"}),UNGRADED:s.jsx(gt,{className:"size-3.5 text-muted-foreground"}),UNKNOWN:s.jsx(ss,{className:"size-3.5 text-muted-foreground/60"})},Hu={project:{label:"Project",icon:s.jsx(_o,{className:"size-4"})},global:{label:"Global",icon:s.jsx(Hn,{className:"size-4"})},system:{label:"System",icon:s.jsx(Hn,{className:"size-4"})},admin:{label:"Admin",icon:s.jsx(Hn,{className:"size-4"})}};function qu({scope:e,skills:t,pathname:n,defaultOpen:r}){const i=Hu[e]??{label:e,icon:s.jsx(Hn,{className:"size-4"})},a=t.some(c=>n===`/skills/${encodeURIComponent(c.name)}`),[l,o]=M.useState(r||a);return M.useEffect(()=>{a&&o(!0)},[a]),s.jsx(Sa,{open:l,onOpenChange:o,className:"group/collapsible",children:s.jsxs(qn,{children:[s.jsxs(Ca,{render:s.jsx($n,{tooltip:i.label}),children:[i.icon,s.jsx("span",{children:i.label}),s.jsx(U,{variant:"secondary",className:"ml-auto h-4 px-1.5 text-[10px]",children:t.length}),s.jsx(an,{className:"ml-1 size-4 shrink-0 transition-transform duration-200 group-data-[open]/collapsible:rotate-90"})]}),s.jsx(Ea,{children:s.jsx(Fu,{children:t.map(c=>{const u=n===`/skills/${encodeURIComponent(c.name)}`;return s.jsx(Bu,{children:s.jsxs(Uu,{isActive:u,render:s.jsx(qt,{to:`/skills/${encodeURIComponent(c.name)}`}),children:[za[c.status],s.jsx("span",{className:"truncate",children:c.name}),s.jsx(U,{variant:c.status==="CRITICAL"?"destructive":c.status==="HEALTHY"?"outline":"secondary",className:"ml-auto h-4 text-[10px] px-1.5 shrink-0",children:xt(c.passRate)})]})},c.name)})})})]})})}function $u({skills:e,search:t,onSearchChange:n,version:r,...i}){const a=Sl(),l=M.useMemo(()=>{const c={};for(const p of e){const f=p.scope??"unknown";c[f]||(c[f]=[]),c[f].push(p)}const u=["project","global","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(Pu,{collapsible:"offcanvas",...i,children:[s.jsx(Ru,{children:s.jsx(pr,{children:s.jsx(qn,{children:s.jsxs($n,{className:"data-[slot=sidebar-menu-button]:!p-1.5",render:s.jsx(qt,{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(Mu,{children:[s.jsx(ii,{children:s.jsx(ai,{children:s.jsxs("div",{className:"relative",children:[s.jsx(Po,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(pu,{"aria-label":"Filter skills",placeholder:"Filter skills...",value:t,onChange:c=>n(c.target.value),className:"h-8 pl-8 text-sm"})]})})}),s.jsxs(ii,{className:"flex-1",children:[s.jsx(Du,{children:"Skills"}),s.jsx(ai,{children:s.jsxs(pr,{children:[o?l.map(({scope:c,skills:u})=>s.jsx(qu,{scope:c,skills:u,pathname:a.pathname,defaultOpen:c==="project"},c)):e.map(c=>{const u=a.pathname===`/skills/${encodeURIComponent(c.name)}`;return s.jsx(qn,{children:s.jsxs($n,{isActive:u,tooltip:`${c.name} — ${xt(c.passRate)}`,render:s.jsx(qt,{to:`/skills/${encodeURIComponent(c.name)}`}),children:[za[c.status],s.jsx("span",{className:"truncate",children:c.name}),s.jsx(U,{variant:c.status==="CRITICAL"?"destructive":c.status==="HEALTHY"?"outline":"secondary",className:"ml-auto h-4 text-[10px] px-1.5 shrink-0",children:xt(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(Ou,{children:[s.jsx(pr,{children:s.jsx(qn,{children:s.jsxs($n,{isActive:a.pathname==="/status",tooltip:"System Status",render:s.jsx(qt,{to:"/status"}),children:[s.jsx(la,{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(sn,{className:"size-3"}),s.jsxs("span",{children:["selftune",r?` v${r}`:""]})]})]})]})}const Pa=M.createContext(void 0),_a="selftune-theme",Vu=["dark","light","system"];function Qu(e){const t=localStorage.getItem(_a);return Vu.includes(t)?t:e}function Ku({children:e,defaultTheme:t="dark"}){const[n,r]=M.useState(()=>Qu(t));return M.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(Pa.Provider,{value:{theme:n,setTheme:i=>{localStorage.setItem(_a,i),r(i)}},children:e})}function Gu(){const e=M.useContext(Pa);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function Wu(){const{theme:e,setTheme:t}=Gu();return s.jsxs(ye,{variant:"ghost",size:"icon",className:"relative size-8",onClick:()=>t(e==="dark"?"light":"dark"),children:[s.jsx(Ao,{className:"size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s.jsx(Ro,{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 xs(){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(_u,{className:"-ml-1"}),s.jsx(xu,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),s.jsx("div",{className:"ml-auto",children:s.jsx(Wu,{})})]})})}const li={created:"outline",validated:"secondary",deployed:"default",rejected:"destructive",rolled_back:"destructive",pending:"secondary"};function Yu({evolution:e,pendingProposals:t,unmatchedQueries:n}){return e.length>0||t.length>0||n.length>0?s.jsxs(Z,{children:[s.jsxs(ee,{children:[s.jsxs(te,{className:"flex items-center gap-2 text-sm",children:[s.jsx(sn,{className:"size-4"}),"Activity"]}),s.jsx(ie,{children:"Recent evolution events and queries"})]}),s.jsx(Be,{children:s.jsxs(hs,{defaultValue:t.length>0?"pending":e.length>0?"timeline":"unmatched",children:[s.jsxs(fs,{className:"w-full",children:[t.length>0&&s.jsxs(_e,{value:"pending",className:"flex-1 gap-1.5",children:[s.jsx(Oo,{className:"size-3.5"}),"Pending",s.jsx(U,{variant:"secondary",className:"ml-1 h-4 px-1.5 text-[10px]",children:t.length})]}),s.jsxs(_e,{value:"timeline",className:"flex-1 gap-1.5",children:[s.jsx(is,{className:"size-3.5"}),"Timeline"]}),n.length>0&&s.jsxs(_e,{value:"unmatched",className:"flex-1 gap-1.5",children:[s.jsx(oa,{className:"size-3.5"}),"Unmatched",s.jsx(U,{variant:"destructive",className:"ml-1 h-4 px-1.5 text-[10px]",children:n.length})]})]}),t.length>0&&s.jsx(tt,{value:"pending",className:"mt-4 space-y-3",children:t.slice(0,10).map(i=>s.jsxs("div",{className:"flex gap-3",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(U,{variant:li[i.action]??"secondary",className:"text-[10px]",children:i.action}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:be(i.timestamp)})]}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.details})]})]},i.proposal_id))}),s.jsxs(tt,{value:"timeline",className:"mt-4 space-y-3",children:[e.slice(0,30).map((i,a)=>s.jsxs("div",{className:"flex gap-3",children:[s.jsx("div",{className:`mt-1 size-2 shrink-0 rounded-full ${i.action==="deployed"?"bg-emerald-500":i.action==="rejected"||i.action==="rolled_back"?"bg-red-500":i.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(U,{variant:li[i.action]??"secondary",className:"text-[10px]",children:i.action}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:be(i.timestamp)})]}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.details}),s.jsxs("span",{className:"text-[10px] text-muted-foreground/60 font-mono",children:["#",i.proposal_id.slice(0,8)]})]})]},`${i.proposal_id}-${a}`)),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(tt,{value:"unmatched",className:"mt-4 space-y-2",children:n.slice(0,15).map((i,a)=>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:be(i.timestamp)}),s.jsx("p",{className:"text-xs font-mono text-foreground/80 line-clamp-2",children:i.query})]})]},`${i.session_id}-${a}`))})]})})]}):s.jsxs(Z,{children:[s.jsx(ee,{children:s.jsxs(te,{className:"flex items-center gap-2 text-sm",children:[s.jsx(sn,{className:"size-4"}),"Activity"]})}),s.jsx(Be,{children:s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No recent activity"})})]})}function Xu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ju=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ed={};function oi(e,t){return(ed.jsx?Zu:Ju).test(e)}const td=/[ \t\n\f\r]/g;function nd(e){return typeof e=="object"?e.type==="text"?ci(e.value):!1:ci(e)}function ci(e){return e.replace(td,"")===""}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 Aa(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 Se{constructor(t,n){this.attribute=n,this.property=t}}Se.prototype.attribute="";Se.prototype.booleanish=!1;Se.prototype.boolean=!1;Se.prototype.commaOrSpaceSeparated=!1;Se.prototype.commaSeparated=!1;Se.prototype.defined=!1;Se.prototype.mustUseProperty=!1;Se.prototype.number=!1;Se.prototype.overloadedBoolean=!1;Se.prototype.property="";Se.prototype.spaceSeparated=!1;Se.prototype.space=void 0;let rd=0;const Q=Dt(),ue=Dt(),Vr=Dt(),T=Dt(),re=Dt(),$t=Dt(),Ee=Dt();function Dt(){return 2**++rd}const Qr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Q,booleanish:ue,commaOrSpaceSeparated:Ee,commaSeparated:$t,number:T,overloadedBoolean:Vr,spaceSeparated:re},Symbol.toStringTag,{value:"Module"})),mr=Object.keys(Qr);class gs extends Se{constructor(t,n,r,i){let a=-1;if(super(t,n),ui(this,"space",i),typeof r=="number")for(;++a<mr.length;){const l=mr[a];ui(this,mr[a],(r&Qr[l])===Qr[l])}}}gs.prototype.defined=!0;function ui(e,t,n){n&&(e[t]=n)}function ln(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new gs(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 Ra=ln({properties:{ariaActiveDescendant:null,ariaAtomic:ue,ariaAutoComplete:null,ariaBusy:ue,ariaChecked:ue,ariaColCount:T,ariaColIndex:T,ariaColSpan:T,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:T,ariaLive:null,ariaModal:ue,ariaMultiLine:ue,ariaMultiSelectable:ue,ariaOrientation:null,ariaOwns:re,ariaPlaceholder:null,ariaPosInSet:T,ariaPressed:ue,ariaReadOnly:ue,ariaRelevant:null,ariaRequired:ue,ariaRoleDescription:re,ariaRowCount:T,ariaRowIndex:T,ariaRowSpan:T,ariaSelected:ue,ariaSetSize:T,ariaSort:null,ariaValueMax:T,ariaValueMin:T,ariaValueNow:T,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Oa(e,t){return t in e?e[t]:t}function Ma(e,t){return Oa(e,t.toLowerCase())}const sd=ln({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$t,acceptCharset:re,accessKey:re,action:null,allow:null,allowFullScreen:Q,allowPaymentRequest:Q,allowUserMedia:Q,alt:null,as:null,async:Q,autoCapitalize:null,autoComplete:re,autoFocus:Q,autoPlay:Q,blocking:re,capture:null,charSet:null,checked:Q,cite:null,className:re,cols:T,colSpan:null,content:null,contentEditable:ue,controls:Q,controlsList:re,coords:T|$t,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Q,defer:Q,dir:null,dirName:null,disabled:Q,download:Vr,draggable:ue,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Q,formTarget:null,headers:re,height:T,hidden:Vr,high:T,href:null,hrefLang:null,htmlFor:re,httpEquiv:re,id:null,imageSizes:null,imageSrcSet:null,inert:Q,inputMode:null,integrity:null,is:null,isMap:Q,itemId:null,itemProp:re,itemRef:re,itemScope:Q,itemType:re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Q,low:T,manifest:null,max:null,maxLength:T,media:null,method:null,min:null,minLength:T,multiple:Q,muted:Q,name:null,nonce:null,noModule:Q,noValidate:Q,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:Q,optimum:T,pattern:null,ping:re,placeholder:null,playsInline:Q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Q,referrerPolicy:null,rel:re,required:Q,reversed:Q,rows:T,rowSpan:T,sandbox:re,scope:null,scoped:Q,seamless:Q,selected:Q,shadowRootClonable:Q,shadowRootDelegatesFocus:Q,shadowRootMode:null,shape:null,size:T,sizes:null,slot:null,span:T,spellCheck:ue,src:null,srcDoc:null,srcLang:null,srcSet:null,start:T,step:null,style:null,tabIndex:T,target:null,title:null,translate:null,type:null,typeMustMatch:Q,useMap:null,value:ue,width:T,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:re,axis:null,background:null,bgColor:null,border:T,borderColor:null,bottomMargin:T,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Q,declare:Q,event:null,face:null,frame:null,frameBorder:null,hSpace:T,leftMargin:T,link:null,longDesc:null,lowSrc:null,marginHeight:T,marginWidth:T,noResize:Q,noHref:Q,noShade:Q,noWrap:Q,object:null,profile:null,prompt:null,rev:null,rightMargin:T,rules:null,scheme:null,scrolling:ue,standby:null,summary:null,text:null,topMargin:T,valueType:null,version:null,vAlign:null,vLink:null,vSpace:T,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Q,disableRemotePlayback:Q,prefix:null,property:null,results:T,security:null,unselectable:null},space:"html",transform:Ma}),id=ln({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:Ee,accentHeight:T,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:T,amplitude:T,arabicForm:null,ascent:T,attributeName:null,attributeType:null,azimuth:T,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:T,by:null,calcMode:null,capHeight:T,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:T,diffuseConstant:T,direction:null,display:null,dur:null,divisor:T,dominantBaseline:null,download:Q,dx:null,dy:null,edgeMode:null,editable:null,elevation:T,enableBackground:null,end:null,event:null,exponent:T,externalResourcesRequired:null,fill:null,fillOpacity:T,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:$t,g2:$t,glyphName:$t,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:T,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:T,horizOriginX:T,horizOriginY:T,id:null,ideographic:T,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:T,k:T,k1:T,k2:T,k3:T,k4:T,kernelMatrix:Ee,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:T,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:T,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:T,overlineThickness:T,paintOrder:null,panose1:null,path:null,pathLength:T,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:T,pointsAtY:T,pointsAtZ:T,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ee,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ee,rev:Ee,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ee,requiredFeatures:Ee,requiredFonts:Ee,requiredFormats:Ee,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:T,specularExponent:T,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:T,strikethroughThickness:T,string:null,stroke:null,strokeDashArray:Ee,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:T,strokeOpacity:T,strokeWidth:null,style:null,surfaceScale:T,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ee,tabIndex:T,tableValues:null,target:null,targetX:T,targetY:T,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ee,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:T,underlineThickness:T,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:T,values:null,vAlphabetic:T,vMathematical:T,vectorEffect:null,vHanging:T,vIdeographic:T,version:null,vertAdvY:T,vertOriginX:T,vertOriginY:T,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:T,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Oa}),Da=ln({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()}}),La=ln({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ma}),Fa=ln({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ad={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"},ld=/[A-Z]/g,di=/-[a-z]/g,od=/^data[-\w.:]+$/i;function cd(e,t){const n=$r(t);let r=t,i=Se;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&od.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(di,dd);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!di.test(a)){let l=a.replace(ld,ud);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=gs}return new i(r,t)}function ud(e){return"-"+e.toLowerCase()}function dd(e){return e.charAt(1).toUpperCase()}const hd=Aa([Ra,sd,Da,La,Fa],"html"),ys=Aa([Ra,id,Da,La,Fa],"svg");function fd(e){return e.join(" ").trim()}var Ut={},xr,hi;function pd(){if(hi)return xr;hi=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(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var C=1,E=1;function I(_){var z=_.match(t);z&&(C+=z.length);var Y=_.lastIndexOf(c);E=~Y?_.length-Y:E+_.length}function F(){var _={line:C,column:E};return function(z){return z.position=new N(_),B(),z}}function N(_){this.start=_,this.end={line:C,column:E},this.source=y.source}N.prototype.content=v;function R(_){var z=new Error(y.source+":"+C+":"+E+": "+_);if(z.reason=_,z.filename=y.source,z.line=C,z.column=E,z.source=v,!y.silent)throw z}function L(_){var z=_.exec(v);if(z){var Y=z[0];return I(Y),v=v.slice(Y.length),z}}function B(){L(n)}function q(_){var z;for(_=_||[];z=O();)z!==!1&&_.push(z);return _}function O(){var _=F();if(!(u!=v.charAt(0)||d!=v.charAt(1))){for(var z=2;h!=v.charAt(z)&&(d!=v.charAt(z)||u!=v.charAt(z+1));)++z;if(z+=2,h===v.charAt(z-1))return R("End of comment missing");var Y=v.slice(2,z-2);return E+=2,I(Y),v=v.slice(z),E+=2,_({type:p,comment:Y})}}function k(){var _=F(),z=L(r);if(z){if(O(),!L(i))return R("property missing ':'");var Y=L(a),ae=_({type:f,property:w(z[0].replace(e,h)),value:Y?w(Y[0].replace(e,h)):h});return L(l),ae}}function j(){var _=[];q(_);for(var z;z=k();)z!==!1&&(_.push(z),q(_));return _}return B(),j()}function w(v){return v?v.replace(o,h):h}return xr=b,xr}var fi;function md(){if(fi)return Ut;fi=1;var e=Ut&&Ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.default=n;const t=e(pd());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 Ut}var fn={},pi;function xd(){if(pi)return fn;pi=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.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 fn.camelCase=c,fn}var pn,mi;function gd(){if(mi)return pn;mi=1;var e=pn&&pn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(md()),n=xd();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,pn=r,pn}var yd=gd();const bd=ia(yd),Ba=Ua("end"),bs=Ua("start");function Ua(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 vd(e){const t=bs(e),n=Ba(e);if(t&&n)return{start:t,end:n}}function wn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xi(e.position):"start"in e||"end"in e?xi(e):"line"in e||"column"in e?Kr(e):""}function Kr(e){return gi(e&&e.line)+":"+gi(e&&e.column)}function xi(e){return Kr(e&&e.start)+"-"+Kr(e&&e.end)}function gi(e){return e&&typeof e=="number"?e:1}class me 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=wn(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}}me.prototype.file="";me.prototype.name="";me.prototype.reason="";me.prototype.message="";me.prototype.stack="";me.prototype.column=void 0;me.prototype.line=void 0;me.prototype.ancestors=void 0;me.prototype.cause=void 0;me.prototype.fatal=void 0;me.prototype.place=void 0;me.prototype.ruleId=void 0;me.prototype.source=void 0;const vs={}.hasOwnProperty,jd=new Map,wd=/[A-Z]/g,Nd=new Set(["table","tbody","thead","tfoot","tr"]),kd=new Set(["td","th"]),Ha="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Sd(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=Ad(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"?ys:hd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qa(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qa(e,t,n){if(t.type==="element")return Cd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ed(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Td(e,t,n);if(t.type==="mdxjsEsm")return Id(e,t);if(t.type==="root")return zd(e,t,n);if(t.type==="text")return Pd(e,t)}function Cd(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ys,e.schema=i),e.ancestors.push(t);const a=Va(e,t.tagName,!1),l=Rd(e,t);let o=ws(e,t);return Nd.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!nd(c):!0})),$a(e,l,a,t),js(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Ed(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)}En(e,t.position)}function Id(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);En(e,t.position)}function Td(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ys,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:Va(e,t.name,!0),l=Od(e,t),o=ws(e,t);return $a(e,l,a,t),js(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function zd(e,t,n){const r={};return js(r,ws(e,t)),e.create(t,e.Fragment,r,n)}function Pd(e,t){return t.value}function $a(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function js(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 Ad(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 Rd(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&vs.call(t.properties,i)){const a=Md(e,i,t.properties[i]);if(a){const[l,o]=a;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&kd.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 Od(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 En(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 En(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function ws(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:jd;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=qa(e,a,l);o!==void 0&&n.push(o)}return n}function Md(e,t,n){const r=cd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Xu(n):fd(n)),r.property==="style"){let i=typeof n=="object"?n:Dd(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ld(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ad[r.property]||r.property:r.attribute,n]}}function Dd(e,t){try{return bd(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new me("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=Ha+"#cannot-parse-style-attribute",i}}function Va(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=oi(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=oi(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return vs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);En(e)}function En(e,t){const n=new me("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=Ha+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ld(e){const t={};let n;for(n in e)vs.call(e,n)&&(t[Fd(n)]=e[n]);return t}function Fd(e){let t=e.replace(wd,Bd);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Bd(e){return"-"+e.toLowerCase()}const gr={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"]},Ud={};function Hd(e,t){const n=Ud,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Qa(e,r,i)}function Qa(e,t,n){if(qd(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 yi(e.children,t,n)}return Array.isArray(e)?yi(e,t,n):""}function yi(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Qa(e[i],t,n);return r.join("")}function qd(e){return!!(e&&typeof e=="object")}const bi=document.createElement("i");function Ns(e){const t="&"+e+";";bi.innerHTML=t;const n=bi.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ge(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?(Ge(e,e.length,0,t),e):t}const vi={}.hasOwnProperty;function $d(e){const t={};let n=-1;for(;++n<e.length;)Vd(t,e[n]);return t}function Vd(e,t){let n;for(n in t){const i=(vi.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){vi.call(i,l)||(i[l]=[]);const o=a[l];Qd(i[l],Array.isArray(o)?o:o?[o]:[])}}}function Qd(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ge(e,0,0,r)}function Ka(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 Vt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qe=yt(/[A-Za-z]/),Ie=yt(/[\dA-Za-z]/),Kd=yt(/[#-'*+\--9=?A-Z^-~]/);function Gr(e){return e!==null&&(e<32||e===127)}const Wr=yt(/\d/),Gd=yt(/[\dA-Fa-f]/),Wd=yt(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function ke(e){return e!==null&&(e<0||e===32)}function X(e){return e===-2||e===-1||e===32}const Yd=yt(new RegExp("\\p{P}|\\p{S}","u")),Xd=yt(/\s/);function yt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function on(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 se(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(c){return X(c)?(e.enter(n),o(c)):t(c)}function o(c){return X(c)&&a++<i?(e.consume(c),o):(e.exit(n),t(c))}}const Jd={tokenize:Zd};function Zd(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"),se(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 $(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),l)}}const eh={tokenize:th},ji={tokenize:nh};function th(e){const t=this,n=[];let r=0,i,a,l;return o;function o(E){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,c,u)(E)}return u(E)}function c(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const I=t.events.length;let F=I,N;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){N=t.events[F][1].end;break}y(r);let R=I;for(;R<t.events.length;)t.events[R][1].end={...N},R++;return Ge(t.events,F+1,0,t.events.slice(I)),t.events.length=R,u(E)}return o(E)}function u(E){if(r===n.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return b(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ji,d,h)(E)}function d(E){return i&&C(),y(r),p(E)}function h(E){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,b(E)}function p(E){return t.containerState={},e.attempt(ji,f,b)(E)}function f(E){return r++,n.push([t.currentConstruct,t.containerState]),p(E)}function b(E){if(E===null){i&&C(),y(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(E)}function w(E){if(E===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(E);return}return $(E)?(e.consume(E),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(E),w)}function v(E,I){const F=t.sliceStream(E);if(I&&F.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(F),t.parser.lazy[E.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<l&&(!i.events[N][1].end||i.events[N][1].end.offset>l))return;const R=t.events.length;let L=R,B,q;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(B){q=t.events[L][1].end;break}B=!0}for(y(r),N=R;N<t.events.length;)t.events[N][1].end={...q},N++;Ge(t.events,L+1,0,t.events.slice(R)),t.events.length=N}}function y(E){let I=n.length;for(;I-- >E;){const F=n[I];t.containerState=F[1],F[0].exit.call(t,e)}n.length=E}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function nh(e,t,n){return se(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wi(e){if(e===null||ke(e)||Xd(e))return 1;if(Yd(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:rh,tokenize:sh};function rh(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};Ni(h,-c),Ni(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,Ge(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 sh(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wi(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=wi(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 Ni(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ih={name:"autolink",tokenize:ah};function ah(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 Qe(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):Kd(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 ar={partial:!0,tokenize:lh};function lh(e,t,n){return r;function r(a){return X(a)?se(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||$(a)?t(a):n(a)}}const Ga={continuation:{tokenize:ch},exit:uh,name:"blockQuote",tokenize:oh};function oh(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 X(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function ch(e,t,n){const r=this;return i;function i(l){return X(l)?se(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Ga,t,n)(l)}}function uh(e){e.exit("blockQuote")}const Wa={name:"characterEscape",tokenize:dh};function dh(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 Wd(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Ya={name:"characterReference",tokenize:hh};function hh(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=Gd,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&&!Ns(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 ki={partial:!0,tokenize:ph},Si={concrete:!0,name:"codeFenced",tokenize:fh};function fh(e,t,n){const r=this,i={partial:!0,tokenize:F};let a=0,l=0,o;return c;function c(N){return u(N)}function u(N){const R=r.events[r.events.length-1];return a=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,o=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(N)}function d(N){return N===o?(l++,e.consume(N),d):l<3?n(N):(e.exit("codeFencedFenceSequence"),X(N)?se(e,h,"whitespace")(N):h(N))}function h(N){return N===null||$(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(ki,w,I)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||$(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):X(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),se(e,f,"whitespace")(N)):N===96&&N===o?n(N):(e.consume(N),p)}function f(N){return N===null||$(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===null||$(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===o?n(N):(e.consume(N),b)}function w(N){return e.attempt(i,I,v)(N)}function v(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),y}function y(N){return a>0&&X(N)?se(e,C,"linePrefix",a+1)(N):C(N)}function C(N){return N===null||$(N)?e.check(ki,w,I)(N):(e.enter("codeFlowValue"),E(N))}function E(N){return N===null||$(N)?(e.exit("codeFlowValue"),C(N)):(e.consume(N),E)}function I(N){return e.exit("codeFenced"),t(N)}function F(N,R,L){let B=0;return q;function q(z){return N.enter("lineEnding"),N.consume(z),N.exit("lineEnding"),O}function O(z){return N.enter("codeFencedFence"),X(z)?se(N,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z)}function k(z){return z===o?(N.enter("codeFencedFenceSequence"),j(z)):L(z)}function j(z){return z===o?(B++,N.consume(z),j):B>=l?(N.exit("codeFencedFenceSequence"),X(z)?se(N,_,"whitespace")(z):_(z)):L(z)}function _(z){return z===null||$(z)?(N.exit("codeFencedFence"),R(z)):L(z)}}}function ph(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 yr={name:"codeIndented",tokenize:xh},mh={partial:!0,tokenize:gh};function xh(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),se(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):$(u)?e.attempt(mh,l,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||$(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function gh(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):$(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):se(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):$(l)?i(l):n(l)}}const yh={name:"codeText",previous:vh,resolve:bh,tokenize:jh};function bh(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 vh(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jh(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)):$(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||$(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 wh{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&&mn(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),mn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),mn(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);mn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);mn(this.left,n.reverse())}}}function mn(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 Xa(e){const t={};let n=-1,r,i,a,l,o,c,u;const d=new wh(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,Nh(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 Ge(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Nh(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,w=0;const v=[w];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&&(w=p+1,v.push(w),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),p=v.length;p--;){const y=o.slice(v[p],v[p+1]),C=a.pop();c.push([C,C+y.length-1]),e.splice(C,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 kh={resolve:Ch,tokenize:Eh},Sh={partial:!0,tokenize:Ih};function Ch(e){return Xa(e),e}function Eh(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):$(o)?e.check(Sh,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 Ih(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),se(e,a,"linePrefix")}function a(l){if(l===null||$(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 Ja(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"}),w(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||$(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 w(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++,w):y===41?(e.consume(y),d--,w):y===null||y===32||y===40||Gr(y)?n(y):(e.consume(y),y===92?v:w)}function v(y){return y===40||y===41||y===92?(e.consume(y),w):w(y)}}function Za(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):$(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||$(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),c||(c=!X(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function el(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):$(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),se(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||$(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 Nn(e,t){let n;return r;function r(i){return $(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):X(i)?se(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Th={name:"definition",tokenize:Ph},zh={partial:!0,tokenize:_h};function Ph(e,t,n){const r=this;let i;return a;function a(f){return e.enter("definition"),l(f)}function l(f){return Za.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=Vt(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)?Nn(e,u)(f):u(f)}function u(f){return Ja(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(zh,h,h)(f)}function h(f){return X(f)?se(e,p,"whitespace")(f):p(f)}function p(f){return f===null||$(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)?Nn(e,i)(o):n(o)}function i(o){return el(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return X(o)?se(e,l,"whitespace")(o):l(o)}function l(o){return o===null||$(o)?t(o):n(o)}}const Ah={name:"hardBreakEscape",tokenize:Rh};function Rh(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return $(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Oh={name:"headingAtx",resolve:Mh,tokenize:Dh};function Mh(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"},Ge(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Dh(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||$(d)?(e.exit("atxHeading"),t(d)):X(d)?se(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 Lh=["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"],Ci=["pre","script","style","textarea"],Fh={concrete:!0,name:"htmlFlow",resolveTo:Hh,tokenize:qh},Bh={partial:!0,tokenize:Vh},Uh={partial:!0,tokenize:$h};function Hh(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 qh(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,w):x===63?(e.consume(x),i=3,r.interrupt?t:m):Qe(x)?(e.consume(x),l=String.fromCharCode(x),v):n(x)}function p(x){return x===45?(e.consume(x),i=2,f):x===91?(e.consume(x),i=5,o=0,b):Qe(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 Oe="CDATA[";return x===Oe.charCodeAt(o++)?(e.consume(x),o===Oe.length?r.interrupt?t:k:b):n(x)}function w(x){return Qe(x)?(e.consume(x),l=String.fromCharCode(x),v):n(x)}function v(x){if(x===null||x===47||x===62||ke(x)){const Oe=x===47,bt=l.toLowerCase();return!Oe&&!a&&Ci.includes(bt)?(i=1,r.interrupt?t(x):k(x)):Lh.includes(l.toLowerCase())?(i=6,Oe?(e.consume(x),y):r.interrupt?t(x):k(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?C(x):E(x))}return x===45||Ie(x)?(e.consume(x),l+=String.fromCharCode(x),v):n(x)}function y(x){return x===62?(e.consume(x),r.interrupt?t:k):n(x)}function C(x){return X(x)?(e.consume(x),C):q(x)}function E(x){return x===47?(e.consume(x),q):x===58||x===95||Qe(x)?(e.consume(x),I):X(x)?(e.consume(x),E):q(x)}function I(x){return x===45||x===46||x===58||x===95||Ie(x)?(e.consume(x),I):F(x)}function F(x){return x===61?(e.consume(x),N):X(x)?(e.consume(x),F):E(x)}function N(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),c=x,R):X(x)?(e.consume(x),N):L(x)}function R(x){return x===c?(e.consume(x),c=null,B):x===null||$(x)?n(x):(e.consume(x),R)}function L(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||ke(x)?F(x):(e.consume(x),L)}function B(x){return x===47||x===62||X(x)?E(x):n(x)}function q(x){return x===62?(e.consume(x),O):n(x)}function O(x){return x===null||$(x)?k(x):X(x)?(e.consume(x),O):n(x)}function k(x){return x===45&&i===2?(e.consume(x),Y):x===60&&i===1?(e.consume(x),ae):x===62&&i===4?(e.consume(x),Re):x===63&&i===3?(e.consume(x),m):x===93&&i===5?(e.consume(x),Ae):$(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Bh,We,j)(x)):x===null||$(x)?(e.exit("htmlFlowData"),j(x)):(e.consume(x),k)}function j(x){return e.check(Uh,_,We)(x)}function _(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),z}function z(x){return x===null||$(x)?j(x):(e.enter("htmlFlowData"),k(x))}function Y(x){return x===45?(e.consume(x),m):k(x)}function ae(x){return x===47?(e.consume(x),l="",ve):k(x)}function ve(x){if(x===62){const Oe=l.toLowerCase();return Ci.includes(Oe)?(e.consume(x),Re):k(x)}return Qe(x)&&l.length<8?(e.consume(x),l+=String.fromCharCode(x),ve):k(x)}function Ae(x){return x===93?(e.consume(x),m):k(x)}function m(x){return x===62?(e.consume(x),Re):x===45&&i===2?(e.consume(x),m):k(x)}function Re(x){return x===null||$(x)?(e.exit("htmlFlowData"),We(x)):(e.consume(x),Re)}function We(x){return e.exit("htmlFlow"),t(x)}}function $h(e,t,n){const r=this;return i;function i(l){return $(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 Vh(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ar,t,n)}}const Qh={name:"htmlText",tokenize:Kh};function Kh(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),F):m===63?(e.consume(m),E):Qe(m)?(e.consume(m),L):n(m)}function u(m){return m===45?(e.consume(m),d):m===91?(e.consume(m),a=0,b):Qe(m)?(e.consume(m),C):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):$(m)?(l=h,ae(m)):(e.consume(m),h)}function p(m){return m===45?(e.consume(m),f):h(m)}function f(m){return m===62?Y(m):m===45?p(m):h(m)}function b(m){const Re="CDATA[";return m===Re.charCodeAt(a++)?(e.consume(m),a===Re.length?w:b):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),v):$(m)?(l=w,ae(m)):(e.consume(m),w)}function v(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?Y(m):m===93?(e.consume(m),y):w(m)}function C(m){return m===null||m===62?Y(m):$(m)?(l=C,ae(m)):(e.consume(m),C)}function E(m){return m===null?n(m):m===63?(e.consume(m),I):$(m)?(l=E,ae(m)):(e.consume(m),E)}function I(m){return m===62?Y(m):E(m)}function F(m){return Qe(m)?(e.consume(m),N):n(m)}function N(m){return m===45||Ie(m)?(e.consume(m),N):R(m)}function R(m){return $(m)?(l=R,ae(m)):X(m)?(e.consume(m),R):Y(m)}function L(m){return m===45||Ie(m)?(e.consume(m),L):m===47||m===62||ke(m)?B(m):n(m)}function B(m){return m===47?(e.consume(m),Y):m===58||m===95||Qe(m)?(e.consume(m),q):$(m)?(l=B,ae(m)):X(m)?(e.consume(m),B):Y(m)}function q(m){return m===45||m===46||m===58||m===95||Ie(m)?(e.consume(m),q):O(m)}function O(m){return m===61?(e.consume(m),k):$(m)?(l=O,ae(m)):X(m)?(e.consume(m),O):B(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,j):$(m)?(l=k,ae(m)):X(m)?(e.consume(m),k):(e.consume(m),_)}function j(m){return m===i?(e.consume(m),i=void 0,z):m===null?n(m):$(m)?(l=j,ae(m)):(e.consume(m),j)}function _(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||ke(m)?B(m):(e.consume(m),_)}function z(m){return m===47||m===62||ke(m)?B(m):n(m)}function Y(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function ae(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ve}function ve(m){return X(m)?se(e,Ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):Ae(m)}function Ae(m){return e.enter("htmlTextData"),l(m)}}const Ss={name:"labelEnd",resolveAll:Xh,resolveTo:Jh,tokenize:Zh},Gh={tokenize:ef},Wh={tokenize:tf},Yh={tokenize:nf};function Xh(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&&Ge(e,0,e.length,n),e}function Jh(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]]),Ge(e,a,e.length,o),e}function Zh(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(Vt(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(Gh,d,l?d:h)(p):p===91?e.attempt(Wh,d,l?u:h)(p):l?d(p):h(p)}function u(p){return e.attempt(Yh,d,h)(p)}function d(p){return t(p)}function h(p){return a._balanced=!0,n(p)}}function ef(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)?Nn(e,a)(h):a(h)}function a(h){return h===41?d(h):Ja(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return ke(h)?Nn(e,c)(h):d(h)}function o(h){return n(h)}function c(h){return h===34||h===39||h===40?el(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return ke(h)?Nn(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 tf(e,t,n){const r=this;return i;function i(o){return Za.call(r,e,a,l,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(Vt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function nf(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 rf={name:"labelStartImage",resolveAll:Ss.resolveAll,tokenize:sf};function sf(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 af={name:"labelStartLink",resolveAll:Ss.resolveAll,tokenize:lf};function lf(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:of};function of(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),se(e,t,"linePrefix")}}const Vn={name:"thematicBreak",tokenize:cf};function cf(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||$(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),X(u)?se(e,o,"whitespace")(u):o(u))}}const je={continuation:{tokenize:ff},exit:mf,name:"list",tokenize:hf},uf={partial:!0,tokenize:xf},df={partial:!0,tokenize:pf};function hf(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(Vn,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(ar,r.interrupt?n:d,e.attempt(uf,p,h))}function d(f){return r.containerState.initialBlankLine=!0,a++,p(f)}function h(f){return X(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 ff(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ar,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,se(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!X(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(df,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,se(e,e.attempt(je,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function pf(e,t,n){const r=this;return se(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 mf(e){e.exit(this.containerState.type)}function xf(e,t,n){const r=this;return se(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!X(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Ei={name:"setextUnderline",resolveTo:gf,tokenize:yf};function gf(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 yf(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"),X(u)?se(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||$(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const bf={tokenize:vf};function vf(e){const t=this,n=e.attempt(ar,r,e.attempt(this.parser.constructs.flowInitial,i,se(e,e.attempt(this.parser.constructs.flow,i,e.attempt(kh,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 jf={resolveAll:nl()},wf=tl("string"),Nf=tl("text");function tl(e){return{resolveAll:nl(e==="text"?kf: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 nl(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 kf(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 Sf={42:je,43:je,45:je,48:je,49:je,50:je,51:je,52:je,53:je,54:je,55:je,56:je,57:je,62:Ga},Cf={91:Th},Ef={[-2]:yr,[-1]:yr,32:yr},If={35:Oh,42:Vn,45:[Ei,Vn],60:Fh,61:Ei,95:Vn,96:Si,126:Si},Tf={38:Ya,92:Wa},zf={[-5]:br,[-4]:br,[-3]:br,33:rf,38:Ya,42:Yr,60:[ih,Qh],91:af,92:[Ah,Wa],93:Ss,95:Yr,96:yh},Pf={null:[Yr,jf]},_f={null:[42,95]},Af={null:[]},Rf=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_f,contentInitial:Cf,disable:Af,document:Sf,flow:If,flowInitial:Ef,insideSpan:Pf,string:Tf,text:zf},Symbol.toStringTag,{value:"Module"}));function Of(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:R(F),check:R(N),consume:C,enter:E,exit:I,interrupt:R(N,{interrupt:!0})},u={code:null,containerState:{},defineSkip:w,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(O){return l=Pe(l,O),v(),l[l.length-1]!==null?[]:(L(t,0),u.events=ks(a,u.events,u),u.events)}function p(O,k){return Df(f(O),k)}function f(O){return Mf(l,O)}function b(){const{_bufferIndex:O,_index:k,line:j,column:_,offset:z}=r;return{_bufferIndex:O,_index:k,line:j,column:_,offset:z}}function w(O){i[O.line]=O.column,q()}function v(){let O;for(;r._index<l.length;){const k=l[r._index];if(typeof k=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<k.length;)y(k.charCodeAt(r._bufferIndex));else y(k)}}function y(O){d=d(O)}function C(O){$(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,q()):O!==-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=O}function E(O,k){const j=k||{};return j.type=O,j.start=b(),u.events.push(["enter",j,u]),o.push(j),j}function I(O){const k=o.pop();return k.end=b(),u.events.push(["exit",k,u]),k}function F(O,k){L(O,k.from)}function N(O,k){k.restore()}function R(O,k){return j;function j(_,z,Y){let ae,ve,Ae,m;return Array.isArray(_)?We(_):"tokenize"in _?We([_]):Re(_);function Re(he){return cn;function cn(rt){const Lt=rt!==null&&he[rt],Ft=rt!==null&&he.null,Mn=[...Array.isArray(Lt)?Lt:Lt?[Lt]:[],...Array.isArray(Ft)?Ft:Ft?[Ft]:[]];return We(Mn)(rt)}}function We(he){return ae=he,ve=0,he.length===0?Y:x(he[ve])}function x(he){return cn;function cn(rt){return m=B(),Ae=he,he.partial||(u.currentConstruct=he),he.name&&u.parser.constructs.disable.null.includes(he.name)?bt():he.tokenize.call(k?Object.assign(Object.create(u),k):u,c,Oe,bt)(rt)}}function Oe(he){return O(Ae,m),z}function bt(he){return m.restore(),++ve<ae.length?x(ae[ve]):Y}}}function L(O,k){O.resolveAll&&!a.includes(O)&&a.push(O),O.resolve&&Ge(u.events,k,u.events.length-k,O.resolve(u.events.slice(k),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function B(){const O=b(),k=u.previous,j=u.currentConstruct,_=u.events.length,z=Array.from(o);return{from:_,restore:Y};function Y(){r=O,u.previous=k,u.currentConstruct=j,u.events.length=_,o=z,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Mf(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 Df(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 Lf(e){const r={constructs:$d([Rf,...(e||{}).extensions||[]]),content:i(Jd),defined:[],document:i(eh),flow:i(bf),lazy:{},string:i(wf),text:i(Nf)};return r;function i(a){return l;function l(o){return Of(r,a,o)}}}function Ff(e){for(;!Xa(e););return e}const Ii=/[\0\t\n\r]/g;function Bf(){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(Ii.lastIndex=h,u=Ii.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 Uf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Hf(e){return e.replace(Uf,qf)}function qf(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return Ka(n.slice(a?2:1),a?16:10)}return Ns(n)||e}const rl={}.hasOwnProperty;function $f(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Vf(n)(Ff(Lf(n).document().write(Bf()(e,t,!0))))}function Vf(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Rs),autolinkProtocol:B,autolinkEmail:B,atxHeading:a(Ps),blockQuote:a(Ft),characterEscape:B,characterReference:B,codeFenced:a(Mn),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Mn,l),codeText:a(xl,l),codeTextData:B,data:B,codeFlowValue:B,definition:a(gl),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(yl),hardBreakEscape:a(_s),hardBreakTrailing:a(_s),htmlFlow:a(As,l),htmlFlowData:B,htmlText:a(As,l),htmlTextData:B,image:a(bl),label:l,link:a(Rs),listItem:a(vl),listItemValue:p,listOrdered:a(Os,h),listUnordered:a(Os),paragraph:a(jl),reference:x,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ps),strong:a(wl),thematicBreak:a(kl)},exit:{atxHeading:c(),atxHeadingSequence:F,autolink:c(),autolinkEmail:Lt,autolinkProtocol:rt,blockQuote:c(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:bt,characterReferenceMarkerNumeric:bt,characterReferenceValue:he,characterReference:cn,codeFenced:c(v),codeFencedFence:w,codeFencedFenceInfo:f,codeFencedFenceMeta:b,codeFlowValue:q,codeIndented:c(y),codeText:c(z),codeTextData:q,data:q,definition:c(),definitionDestinationString:I,definitionLabelString:C,definitionTitleString:E,emphasis:c(),hardBreakEscape:c(k),hardBreakTrailing:c(k),htmlFlow:c(j),htmlFlowData:q,htmlText:c(_),htmlTextData:q,image:c(ae),label:Ae,labelText:ve,lineEnding:O,link:c(Y),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Oe,resourceDestinationString:m,resourceTitleString:Re,resource:We,setextHeading:c(L),setextHeadingLineSequence:R,setextHeadingText:N,strong:c(),thematicBreak:c()}};sl(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(S){let P={type:"root",children:[]};const V={stack:[P],tokenStack:[],config:t,enter:o,exit:u,buffer:l,resume:d,data:n},K=[];let ne=-1;for(;++ne<S.length;)if(S[ne][1].type==="listOrdered"||S[ne][1].type==="listUnordered")if(S[ne][0]==="enter")K.push(ne);else{const Me=K.pop();ne=i(S,Me,ne)}for(ne=-1;++ne<S.length;){const Me=t[S[ne][0]];rl.call(Me,S[ne][1].type)&&Me[S[ne][1].type].call(Object.assign({sliceSerialize:S[ne][2].sliceSerialize},V),S[ne][1])}if(V.tokenStack.length>0){const Me=V.tokenStack[V.tokenStack.length-1];(Me[1]||Ti).call(V,void 0,Me[0])}for(P.position={start:st(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:st(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},ne=-1;++ne<t.transforms.length;)P=t.transforms[ne](P)||P;return P}function i(S,P,V){let K=P-1,ne=-1,Me=!1,vt,Ye,un,dn;for(;++K<=V;){const Ce=S[K];switch(Ce[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ce[0]==="enter"?ne++:ne--,dn=void 0;break}case"lineEndingBlank":{Ce[0]==="enter"&&(vt&&!dn&&!ne&&!un&&(un=K),dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dn=void 0}if(!ne&&Ce[0]==="enter"&&Ce[1].type==="listItemPrefix"||ne===-1&&Ce[0]==="exit"&&(Ce[1].type==="listUnordered"||Ce[1].type==="listOrdered")){if(vt){let Bt=K;for(Ye=void 0;Bt--;){const Xe=S[Bt];if(Xe[1].type==="lineEnding"||Xe[1].type==="lineEndingBlank"){if(Xe[0]==="exit")continue;Ye&&(S[Ye][1].type="lineEndingBlank",Me=!0),Xe[1].type="lineEnding",Ye=Bt}else if(!(Xe[1].type==="linePrefix"||Xe[1].type==="blockQuotePrefix"||Xe[1].type==="blockQuotePrefixWhitespace"||Xe[1].type==="blockQuoteMarker"||Xe[1].type==="listItemIndent"))break}un&&(!Ye||un<Ye)&&(vt._spread=!0),vt.end=Object.assign({},Ye?S[Ye][1].start:Ce[1].end),S.splice(Ye||K,0,["exit",vt,Ce[2]]),K++,V++}if(Ce[1].type==="listItemPrefix"){const Bt={type:"listItem",_spread:!1,start:Object.assign({},Ce[1].start),end:void 0};vt=Bt,S.splice(K,0,["enter",Bt,Ce[2]]),K++,V++,un=void 0,dn=!0}}}return S[P][1]._spread=Me,V}function a(S,P){return V;function V(K){o.call(this,S(K),K),P&&P.call(this,K)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(S,P,V){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([P,V||void 0]),S.position={start:st(P.start),end:void 0}}function c(S){return P;function P(V){S&&S.call(this,V),u.call(this,V)}}function u(S,P){const V=this.stack.pop(),K=this.tokenStack.pop();if(K)K[0].type!==S.type&&(P?P.call(this,S,K[0]):(K[1]||Ti).call(this,S,K[0]));else throw new Error("Cannot close `"+S.type+"` ("+wn({start:S.start,end:S.end})+"): it’s not open");V.position.end=st(S.end)}function d(){return Hd(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(S){if(this.data.expectingFirstListItemValue){const P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function f(){const S=this.resume(),P=this.stack[this.stack.length-1];P.lang=S}function b(){const S=this.resume(),P=this.stack[this.stack.length-1];P.meta=S}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S.replace(/(\r?\n|\r)$/g,"")}function C(S){const P=this.resume(),V=this.stack[this.stack.length-1];V.label=P,V.identifier=Vt(this.sliceSerialize(S)).toLowerCase()}function E(){const S=this.resume(),P=this.stack[this.stack.length-1];P.title=S}function I(){const S=this.resume(),P=this.stack[this.stack.length-1];P.url=S}function F(S){const P=this.stack[this.stack.length-1];if(!P.depth){const V=this.sliceSerialize(S).length;P.depth=V}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function R(S){const P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function B(S){const V=this.stack[this.stack.length-1].children;let K=V[V.length-1];(!K||K.type!=="text")&&(K=Nl(),K.position={start:st(S.start),end:void 0},V.push(K)),this.stack.push(K)}function q(S){const P=this.stack.pop();P.value+=this.sliceSerialize(S),P.position.end=st(S.end)}function O(S){const P=this.stack[this.stack.length-1];if(this.data.atHardBreak){const V=P.children[P.children.length-1];V.position.end=st(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(P.type)&&(B.call(this,S),q.call(this,S))}function k(){this.data.atHardBreak=!0}function j(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S}function _(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S}function z(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S}function Y(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=P,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function ae(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=P,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function ve(S){const P=this.sliceSerialize(S),V=this.stack[this.stack.length-2];V.label=Hf(P),V.identifier=Vt(P).toLowerCase()}function Ae(){const S=this.stack[this.stack.length-1],P=this.resume(),V=this.stack[this.stack.length-1];if(this.data.inReference=!0,V.type==="link"){const K=S.children;V.children=K}else V.alt=P}function m(){const S=this.resume(),P=this.stack[this.stack.length-1];P.url=S}function Re(){const S=this.resume(),P=this.stack[this.stack.length-1];P.title=S}function We(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function Oe(S){const P=this.resume(),V=this.stack[this.stack.length-1];V.label=P,V.identifier=Vt(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function bt(S){this.data.characterReferenceType=S.type}function he(S){const P=this.sliceSerialize(S),V=this.data.characterReferenceType;let K;V?(K=Ka(P,V==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):K=Ns(P);const ne=this.stack[this.stack.length-1];ne.value+=K}function cn(S){const P=this.stack.pop();P.position.end=st(S.end)}function rt(S){q.call(this,S);const P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(S)}function Lt(S){q.call(this,S);const P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(S)}function Ft(){return{type:"blockquote",children:[]}}function Mn(){return{type:"code",lang:null,meta:null,value:""}}function xl(){return{type:"inlineCode",value:""}}function gl(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yl(){return{type:"emphasis",children:[]}}function Ps(){return{type:"heading",depth:0,children:[]}}function _s(){return{type:"break"}}function As(){return{type:"html",value:""}}function bl(){return{type:"image",title:null,url:"",alt:null}}function Rs(){return{type:"link",title:null,url:"",children:[]}}function Os(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function vl(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function jl(){return{type:"paragraph",children:[]}}function wl(){return{type:"strong",children:[]}}function Nl(){return{type:"text",value:""}}function kl(){return{type:"thematicBreak"}}}function st(e){return{line:e.line,column:e.column,offset:e.offset}}function sl(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?sl(e,r):Qf(e,r)}}function Qf(e,t){let n;for(n in t)if(rl.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 Ti(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wn({start:t.start,end:t.end})+") is still open")}function Kf(e){const t=this;t.parser=n;function n(r){return $f(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Gf(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 Wf(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
5
+ `}]}function Yf(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 Xf(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jf(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zf(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=on(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 ep(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 tp(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function il(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 np(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return il(e,t);const i={src:on(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 rp(e,t){const n={src:on(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 sp(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 ip(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return il(e,t);const i={href:on(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 ap(e,t){const n={href:on(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 lp(e,t,n){const r=e.all(t),i=n?op(n):al(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 op(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=al(n[r])}return t}function al(e){const t=e.spread;return t??e.children.length>1}function cp(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 up(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dp(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hp(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fp(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=Ba(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 pp(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 mp(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const zi=9,Pi=32;function xp(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===zi||a===Pi;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===zi||a===Pi;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function gp(e,t){const n={type:"text",value:xp(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yp(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const bp={blockquote:Gf,break:Wf,code:Yf,delete:Xf,emphasis:Jf,footnoteReference:Zf,heading:ep,html:tp,imageReference:np,image:rp,inlineCode:sp,linkReference:ip,link:ap,listItem:lp,list:cp,paragraph:up,root:dp,strong:hp,table:fp,tableCell:mp,tableRow:pp,text:gp,thematicBreak:yp,toml:Fn,yaml:Fn,definition:Fn,footnoteDefinition:Fn};function Fn(){}const ll=-1,lr=0,kn=1,Wn=2,Cs=3,Es=4,Is=5,Ts=6,ol=7,cl=8,Ai=typeof self=="object"?self:globalThis,vp=(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 lr:case ll:return n(l,i);case kn:{const o=n([],i);for(const c of l)o.push(r(c));return o}case Wn:{const o=n({},i);for(const[c,u]of l)o[r(c)]=r(u);return o}case Cs:return n(new Date(l),i);case Es:{const{source:o,flags:c}=l;return n(new RegExp(o,c),i)}case Is:{const o=n(new Map,i);for(const[c,u]of l)o.set(r(c),r(u));return o}case Ts:{const o=n(new Set,i);for(const c of l)o.add(r(c));return o}case ol:{const{name:o,message:c}=l;return n(new Ai[o](c),i)}case cl: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 Ai[a](l),i)};return r},Ri=e=>vp(new Map,e)(0),Ht="",{toString:jp}={},{keys:wp}=Object,xn=e=>{const t=typeof e;if(t!=="object"||!e)return[lr,t];const n=jp.call(e).slice(8,-1);switch(n){case"Array":return[kn,Ht];case"Object":return[Wn,Ht];case"Date":return[Cs,Ht];case"RegExp":return[Es,Ht];case"Map":return[Is,Ht];case"Set":return[Ts,Ht];case"DataView":return[kn,n]}return n.includes("Array")?[kn,n]:n.includes("Error")?[ol,n]:[Wn,n]},Bn=([e,t])=>e===lr&&(t==="function"||t==="symbol"),Np=(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]=xn(l);switch(o){case lr:{let d=l;switch(c){case"bigint":o=cl,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([ll],l)}return i([o,d],l)}case kn:{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 Wn:{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 wp(l))(e||!Bn(xn(l[p])))&&d.push([a(p),a(l[p])]);return h}case Cs:return i([o,l.toISOString()],l);case Es:{const{source:d,flags:h}=l;return i([o,{source:d,flags:h}],l)}case Is:{const d=[],h=i([o,d],l);for(const[p,f]of l)(e||!(Bn(xn(p))||Bn(xn(f))))&&d.push([a(p),a(f)]);return h}case Ts:{const d=[],h=i([o,d],l);for(const p of l)(e||!Bn(xn(p)))&&d.push(a(p));return h}}const{message:u}=l;return i([o,{name:c,message:u}],l)};return a},Oi=(e,{json:t,lossy:n}={})=>{const r=[];return Np(!(t||n),!!t,new Map,r)(e),r},Yn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ri(Oi(e,t)):structuredClone(e):(e,t)=>Ri(Oi(e,t));function kp(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 Sp(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Cp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||kp,r=e.options.footnoteBackLabel||Sp,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=on(h.toLowerCase());let f=0;const b=[],w=e.footnoteCounts.get(h);for(;w!==void 0&&++f<=w;){b.length>0&&b.push({type:"text",value:" "});let C=typeof n=="string"?n:n(c,f);typeof C=="string"&&(C={type:"text",value:C}),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(C)?C:[C]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const C=v.children[v.children.length-1];C&&C.type==="text"?C.value+=" ":v.children.push({type:"text",value:" "}),v.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:{...Yn(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 ul=(function(e){if(e==null)return zp;if(typeof e=="function")return or(e);if(typeof e=="object")return Array.isArray(e)?Ep(e):Ip(e);if(typeof e=="string")return Tp(e);throw new Error("Expected function, string, or object as test")});function Ep(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ul(e[n]);return or(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Ip(e){const t=e;return or(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Tp(e){return or(t);function t(n){return n&&n.type===e}}function or(e){return t;function t(n,r,i){return!!(Pp(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function zp(){return!0}function Pp(e){return e!==null&&typeof e=="object"&&"type"in e}const dl=[],_p=!0,Mi=!1,Ap="skip";function Rp(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=ul(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=dl,b,w,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(f=Op(n(c,d)),f[0]===Mi))return f;if("children"in c&&c.children){const y=c;if(y.children&&f[0]!==Ap)for(w=(r?y.children.length:-1)+l,v=d.concat(y);w>-1&&w<y.children.length;){const C=y.children[w];if(b=o(C,w,v)(),b[0]===Mi)return b;w=typeof b[1]=="number"?b[1]:w+l}}return f}}}function Op(e){return Array.isArray(e)?e:typeof e=="number"?[_p,e]:e==null?dl:[e]}function hl(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),Rp(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,Mp={};function Dp(e,t){const n=t||Mp,r=new Map,i=new Map,a=new Map,l={...bp,...n.handlers},o={all:u,applyData:Fp,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:c,options:n,patch:Lp,wrap:Up};return hl(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:w,...v}=d,y=Yn(v);return y.children=o.all(d),y}return Yn(d)}return(o.options.unknownHandler||Bp)(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=Di(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=Di(w.value))}Array.isArray(b)?h.push(...b):h.push(b)}}}return h}}function Lp(e,t){e.position&&(t.position=vd(e))}function Fp(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,Yn(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Bp(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 Up(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 Di(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Li(e,t){const n=Dp(e,t),r=n.one(e,void 0),i=Cp(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 Hp(e,t){return e&&"run"in e?async function(n,r){const i=Li(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Li(n,{file:r,...e||t})}}function Fi(e){if(e)throw e}var vr,Bi;function qp(){if(Bi)return vr;Bi=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 vr=function c(){var u,d,h,p,f,b,w=arguments[0],v=1,y=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});v<y;++v)if(u=arguments[v],u!=null)for(d in u)h=o(w,d),p=o(u,d),w!==p&&(C&&p&&(a(p)||(f=i(p)))?(f?(f=!1,b=h&&i(h)?h:[]):b=h&&a(h)?h:{},l(w,{name:d,newValue:c(C,b,p)})):typeof p<"u"&&l(w,{name:d,newValue:p}));return w},vr}var $p=qp();const jr=ia($p);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 Vp(){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?Qp(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 Qp(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 He={basename:Kp,dirname:Gp,extname:Wp,join:Yp,sep:"/"};function Kp(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');On(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 Gp(e){if(On(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 Wp(e){On(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 Yp(...e){let t=-1,n;for(;++t<e.length;)On(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Xp(n)}function Xp(e){On(e);const t=e.codePointAt(0)===47;let n=Jp(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Jp(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 On(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Zp={cwd:em};function em(){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 tm(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 nm(e)}function nm(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 wr=["history","path","basename","stem","extname","dirname"];class fl{constructor(t){let n;t?Zr(t)?n={path:t}:typeof t=="string"||rm(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Zp.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<wr.length;){const a=wr[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)wr.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?He.basename(this.path):void 0}set basename(t){kr(t,"basename"),Nr(t,"basename"),this.path=He.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?He.dirname(this.path):void 0}set dirname(t){Ui(this.basename,"dirname"),this.path=He.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?He.extname(this.path):void 0}set extname(t){if(Nr(t,"extname"),Ui(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=He.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zr(t)&&(t=tm(t)),kr(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?He.basename(this.path,this.extname):void 0}set stem(t){kr(t,"stem"),Nr(t,"stem"),this.path=He.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 me(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 Nr(e,t){if(e&&e.includes(He.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+He.sep+"`")}function kr(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ui(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function rm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sm=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),im={}.hasOwnProperty;class zs extends sm{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=Vp()}copy(){const t=new zs;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(jr(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Er("data",this.frozen),this.namespace[t]=n,this):im.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Er("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 Sr("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sr("process",this.parser||this.Parser),Cr("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);om(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(),Sr("processSync",this.parser||this.Parser),Cr("processSync",this.compiler||this.Compiler),this.process(t,i),qi("processSync","process",n),r;function i(a,l){n=!0,Fi(a),r=l}}run(t,n,r){Hi(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),qi("runSync","run",r),i;function a(l,o){Fi(l),i=o,r=!0}}stringify(t,n){this.freeze();const r=Un(n),i=this.compiler||this.Compiler;return Cr("stringify",i),Hi(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Er("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=jr(!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 w=r[p][1];Jr(w)&&Jr(f)&&(f=jr(!0,w,f)),r[p]=[u,f,...b]}}}}const am=new zs().freeze();function Sr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Er(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 Hi(e){if(!Jr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qi(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Un(e){return lm(e)?e:new fl(e)}function lm(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function om(e){return typeof e=="string"||cm(e)}function cm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const um="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$i=[],Vi={allowDangerousHtml:!0},dm=/^(https?|ircs?|mailto|xmpp)$/i,hm=[{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 fm(e){const t=pm(e),n=mm(e);return xm(t.runSync(t.parse(n),n),e)}function pm(e){const t=e.rehypePlugins||$i,n=e.remarkPlugins||$i,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vi}:Vi;return am().use(Kf).use(n).use(Hp,r).use(t)}function mm(e){const t=e.children||"",n=new fl;return typeof t=="string"&&(n.value=t),n}function xm(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||gm;for(const d of hm)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+um+d.id,void 0);return hl(e,u),Sd(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 gr)if(Object.hasOwn(gr,f)&&Object.hasOwn(d.properties,f)){const b=d.properties[f],w=gr[f];(w===null||w.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 gm(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||dm.test(e.slice(0,t))?e:""}const ym={created:s.jsx(gt,{className:"size-3.5"}),validated:s.jsx(as,{className:"size-3.5"}),deployed:s.jsx(Qn,{className:"size-3.5"}),rejected:s.jsx(Ue,{className:"size-3.5"}),rolled_back:s.jsx(ua,{className:"size-3.5"})},bm={created:"outline",validated:"secondary",deployed:"default",rejected:"destructive",rolled_back:"destructive"};function vm(e){const t=e.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);if(!t)return{meta:{},body:e};const n={};for(const r of t[1].split(`
15
+ `)){const i=r.indexOf(":");if(i>0){const a=r.slice(0,i).trim(),l=r.slice(i+1).trim();a&&l&&(n[a]=l)}}return{meta:n,body:t[2]}}function jm({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}=vm(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(gn,{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(U,{variant:"secondary",className:"text-[10px]",children:"New"})]}),a&&s.jsx("div",{className:"rounded-md border bg-muted/30 p-3",children:s.jsx(jm,{meta:r})}),s.jsx("div",{className:"skill-markdown rounded-md border bg-card p-4",children:s.jsx(fm,{children:i})})]})}function wm(e,t){if(typeof t=="boolean")return t?s.jsx(nt,{className:"size-3.5 text-emerald-500 inline"}):s.jsx(Ue,{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(nt,{className:"size-3.5 text-emerald-500 shrink-0 mt-0.5"}):s.jsx(Ue,{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(U,{variant:"secondary",className:"text-[9px]",children:["expect: ",String(r)]}),i!=null&&s.jsx(U,{variant:"secondary",className:"text-[9px]",children:String(i)})]})]})}function Nm({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(U,{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(km,{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:wm(p,f)})]},p))})]})}function km({entries:e}){const[t,n]=M.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 Sm({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 Cm({evalSet:e}){const[t,n]=M.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(Rt,{className:"size-3.5 text-muted-foreground shrink-0"}):s.jsx(an,{className:"size-3.5 text-muted-foreground shrink-0"}),s.jsx(Do,{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(nt,{className:"size-3.5 text-emerald-500 shrink-0 mt-0.5"}):s.jsx(Ue,{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(U,{variant:"secondary",className:"text-[9px] shrink-0",children:["expect: ",String(o)]})]},a)})})]})}function Ir({entry:e,roundLabel:t,roundStatus:n,prevPassRate:r,currPassRate:i}){const a=n!=="single";return s.jsxs(Z,{className:n==="final"?"border-primary/50 shadow-sm":void 0,children:[s.jsx(ee,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(te,{className:"text-sm flex items-center gap-2",children:[s.jsx(da,{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(U,{variant:"default",className:"text-[10px]",children:"Final"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[a&&s.jsx(Sm,{prev:r,curr:i}),s.jsx(U,{variant:"secondary",className:"text-[10px]",children:e.stage}),e.confidence!==null&&s.jsxs(U,{variant:e.confidence>=.8?"default":e.confidence>=.5?"secondary":"destructive",className:"text-[10px] font-mono",children:[xt(e.confidence)," confidence"]}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:be(e.timestamp)})]})]})}),s.jsxs(Be,{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(Cm,{evalSet:e.eval_set}),e.validation&&Object.keys(e.validation).length>0&&s.jsx(Nm,{validation:e.validation})]})]})}function Em({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(an,{className:"size-4 text-muted-foreground shrink-0"}),s.jsx(da,{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(U,{variant:i?"default":"destructive",className:"text-[9px]",children:i?"Improved":"Regressed"}),s.jsx(U,{variant:"secondary",className:"text-[10px]",children:e.stage}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:be(e.timestamp)})]})]})}function Im({proposalId:e,evolution:t,evidence:n}){const r=M.useMemo(()=>t.filter(h=>h.proposal_id===e).sort((h,p)=>new Date(h.timestamp).getTime()-new Date(p.timestamp).getTime()),[t,e]),i=M.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]=M.useState(new Set),o=h=>{l(p=>{const f=new Set(p);return f.has(h)?f.delete(h):f.add(h),f})},c=M.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}=M.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(ca,{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(Z,{children:[s.jsx(ee,{className:"pb-3",children:s.jsxs(te,{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(Be,{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(Mo,{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:[ym[h.action],s.jsx(U,{variant:bm[h.action]??"secondary",className:"text-[10px] capitalize",children:h.action.replace("_"," ")}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:be(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(tr,{className:"size-3.5 text-emerald-500"}):s.jsx(nr,{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(U,{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(Ir,{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,w)=>{const v=w===p.length-1,y=f?`Round ${w+1} of ${p.length}`:null,C=w>0?ts(p[w-1]):null,E=ts(b),I=`${h}-${b.timestamp}`,F=f?v?"final":"intermediate":"single";return F==="intermediate"&&!a.has(I)?s.jsx(Em,{entry:b,roundLabel:y,onExpand:()=>o(I)},I):F==="intermediate"&&a.has(I)?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("button",{type:"button",onClick:()=>o(I),className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors px-1",children:[s.jsx(Rt,{className:"size-3"}),"Collapse ",y]}),s.jsx(Ir,{entry:b,roundLabel:y,roundStatus:F,prevPassRate:C,currPassRate:E})]},I):s.jsx(Ir,{entry:b,roundLabel:y,roundStatus:F,prevPassRate:C,currPassRate:E},I)})},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 Tm={created:s.jsx(gt,{className:"size-3.5"}),validated:s.jsx(as,{className:"size-3.5"}),deployed:s.jsx(Qn,{className:"size-3.5"}),rejected:s.jsx(Ue,{className:"size-3.5"}),rolled_back:s.jsx(ua,{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"},zm={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"},Pm={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 Am(e){return e[e.length-1].action}function Rm(e){for(let t=e.length-1;t>=0;t--)if(e[t].eval_snapshot)return e[t].eval_snapshot;return null}function Om({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:D("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(tr,{className:"size-2.5"}):s.jsx(nr,{className:"size-2.5"}),r?"+":"",n,"%"]})}const Mm=[{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 Dm(){const[e,t]=M.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(Rt,{className:"size-3"}):s.jsx(an,{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:Mm.map(n=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:D("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 Lm({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(Dm,{}),s.jsx("nav",{className:"flex flex-col",children:r.map(([i,a],l)=>{const o=Am(a),c=t===i,u=a[a.length-1],d=ns[o]??"bg-muted-foreground",h=zm[o]??"ring-muted-foreground/30",p=Pm[o]??"bg-border",f=l===r.length-1,b=Rm(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:D("flex items-center justify-center size-7 rounded-full ring-2 text-white shrink-0 z-10",d,h),children:Tm[o]??s.jsx(gt,{className:"size-3.5"})}),!f&&s.jsx("div",{className:D("w-0.5 flex-1 min-h-[16px]",p)})]}),s.jsxs("button",{type:"button",onClick:()=>n(i),className:D("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(U,{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:be(u.timestamp)})]}),b&&s.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[s.jsx(Om,{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((w,v)=>s.jsx("div",{className:D("size-1.5 rounded-full",ns[w.action]??"bg-muted-foreground")},`${w.action}-${v}`))})]}),u.details&&s.jsx("p",{className:"text-[11px] text-muted-foreground/80 line-clamp-2 mt-1 leading-snug",children:u.details})]})]},i)})})]})}function ge({text:e}){return s.jsxs(jt,{children:[s.jsx(wt,{className:"inline-flex items-center text-muted-foreground/50 hover:text-muted-foreground transition-colors cursor-help",onClick:t=>t.preventDefault(),children:s.jsx(ca,{className:"size-3"})}),s.jsx(Nt,{side:"top",className:"max-w-[220px]",children:e})]})}const Fm={evolve:s.jsx(Fo,{className:"size-3 text-amber-500"}),watch:s.jsx(ls,{className:"size-3 text-blue-500"}),skip:s.jsx(Lo,{className:"size-3 text-muted-foreground"})};function Ki({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:Fm[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(U,{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(U,{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 Bm({run:e}){const[t,n]=M.useState(!1),r=e.skill_actions.filter(a=>a.action!=="skip"),i=e.skill_actions.filter(a=>a.action==="skip");return s.jsxs(Sa,{open:t,onOpenChange:n,children:[s.jsx(Ca,{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:be(e.timestamp)}),e.dry_run&&s.jsx(U,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:"dry-run"}),e.approval_mode==="review"&&s.jsx(U,{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(an,{className:`size-4 text-muted-foreground shrink-0 mt-1 transition-transform duration-200 ${t?"rotate-90":""}`})]})}),s.jsx(Ea,{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(Ki,{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(Ki,{action:a},`${a.skill}-skip-${l}`))})]})]})})]})}function Um({runs:e}){if(e.length===0)return s.jsxs(Z,{children:[s.jsx(ee,{children:s.jsxs(te,{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ds,{className:"size-4"}),"Orchestrate Runs"]})}),s.jsx(Be,{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(Z,{children:[s.jsxs(ee,{children:[s.jsxs(te,{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ds,{className:"size-4"}),"Orchestrate Runs"]}),s.jsxs(ie,{children:[e.length," recent run",e.length!==1?"s":"",t>0&&s.jsxs(s.Fragment,{children:[" · ",t," total deployments"]})]})]}),s.jsx(Be,{className:"space-y-0",children:e.slice(0,10).map(n=>s.jsx(Bm,{run:n},n.run_id))})]})}function Hm({skillsCount:e,avgPassRate:t,unmatchedCount:n,sessionsCount:r,pendingCount:i,evidenceCount:a}){const l=t!==null?`${Math.round(t*100)}%`:"--",o=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(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(rr,{className:"size-3.5"}),"Skills Monitored",s.jsx(ge,{text:"Total number of skills detected and being tracked by selftune"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:e}),s.jsx(pt,{children:s.jsxs(U,{variant:"outline",children:[s.jsx(sn,{className:"size-3"}),"live"]})})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(ha,{className:"size-3.5"}),"Avg Pass Rate",s.jsx(ge,{text:"Average percentage of eval test cases that passed across all graded skills (5+ checks)"})]}),s.jsx(te,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${!o&&t!==null?"text-red-600":""}`,children:l}),t!==null&&s.jsx(pt,{children:s.jsxs(U,{variant:o?"outline":"destructive",children:[o?s.jsx(tr,{className:"size-3"}):s.jsx(nr,{className:"size-3"}),l]})})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(oa,{className:"size-3.5"}),"Unmatched Queries",s.jsx(ge,{text:"User prompts that didn't match any skill's trigger criteria — potential gaps in coverage"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:n}),n>0&&s.jsx(pt,{children:s.jsxs(U,{variant:"destructive",children:[s.jsx(Ot,{className:"size-3"}),"needs attention"]})})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(sn,{className:"size-3.5"}),"Sessions",s.jsx(ge,{text:"Total agent sessions that have been recorded and analyzed"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:r})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(Ot,{className:"size-3.5"}),"Pending Proposals",s.jsx(ge,{text:"Evolution proposals that have been generated but not yet validated or deployed"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:i}),i>0&&s.jsx(pt,{children:s.jsx(U,{variant:"secondary",children:"awaiting review"})})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(ls,{className:"size-3.5"}),"Total Evidence",s.jsx(ge,{text:"Number of evidence entries documenting skill changes with before/after validation results"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:a})]})})]})}const pl=M.createContext(null);function qm(){const e=M.useContext(pl);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(Vo,{className:"size-3 text-muted-foreground"}),s.jsx("span",{className:"sr-only",children:"Drag to reorder"})]}):null}function $m(e){return[{id:"drag",header:()=>null,cell:()=>s.jsx(qm,{})},{id:"select",header:({table:t})=>s.jsx("div",{className:"flex items-center justify-center",children:s.jsx(Ws,{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(Ws,{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(U,{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=qr[t.original.status];return s.jsxs(U,{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:xt(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(is,{className:"size-3"}),s.jsx("span",{className:"font-mono text-xs",children:be(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(U,{variant:t.original.hasEvidence?"outline":"secondary",className:"px-1.5 text-[10px] text-muted-foreground",children:t.original.hasEvidence?"Yes":"No"})}]}function Vm({row:e}){const{transform:t,transition:n,setNodeRef:r,setActivatorNodeRef:i,isDragging:a,attributes:l,listeners:o}=vc({id:e.original.name}),c=M.useMemo(()=>({attributes:l,listeners:o,setActivatorNodeRef:i}),[l,o,i]);return s.jsx(pl.Provider,{value:c,children:s.jsx(De,{"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:jc.Transform.toString(t),transition:n},children:e.getVisibleCells().map(u=>s.jsx(oe,{children:fa(u.column.columnDef.cell,u.getContext())},u.id))})})}function Qm({cards:e,totalCount:t,statusFilter:n,onStatusFilterChange:r,renderSkillName:i}){var O;const[a,l]=M.useState("all"),[o,c]=M.useState([]),[u,d]=M.useState({}),[h,p]=M.useState({}),[f,b]=M.useState([]),[w,v]=M.useState([]),[y,C]=M.useState({pageIndex:0,pageSize:20}),E=M.useMemo(()=>$m(i),[i]),I=M.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]);M.useEffect(()=>{let k=e;a==="attention"?k=e.filter(j=>j.status==="CRITICAL"||j.status==="WARNING"):a==="recent"?k=[...e.filter(j=>j.lastSeen!==null)].sort((j,_)=>{const z=j.lastSeen?new Date(j.lastSeen).getTime():0;return(_.lastSeen?new Date(_.lastSeen).getTime():0)-z}):a==="ungraded"&&(k=e.filter(j=>j.status==="UNGRADED"||j.status==="UNKNOWN")),c(k),C(j=>({...j,pageIndex:0}))},[e,a]);const F=M.useId(),N=nc(hr(yc,{}),hr(gc,{}),hr(xc,{coordinateGetter:mc})),R=rc({data:o,columns:E,state:{sorting:w,columnVisibility:h,rowSelection:u,columnFilters:f,pagination:y},getRowId:k=>k.name,enableRowSelection:!0,onRowSelectionChange:d,onSortingChange:v,onColumnFiltersChange:b,onColumnVisibilityChange:p,onPaginationChange:C,getCoreRowModel:pc(),getFilteredRowModel:fc(),getPaginationRowModel:hc(),getSortedRowModel:dc(),getFacetedRowModel:uc(),getFacetedUniqueValues:cc()}),L=M.useMemo(()=>R.getRowModel().rows.map(k=>k.id),[R.getRowModel().rows]),B=w.length>0;function q(k){if(B)return;const{active:j,over:_}=k;j&&_&&j.id!==_.id&&c(z=>{const Y=z.map(Ae=>Ae.name),ae=Y.indexOf(j.id),ve=Y.indexOf(_.id);return ae===-1||ve===-1?z:bc(z,ae,ve)})}return s.jsxs(hs,{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(Zs,{htmlFor:"view-selector",className:"sr-only",children:"View"}),s.jsxs(ei,{value:a,onValueChange:k=>k&&l(k),children:[s.jsx(ri,{className:"flex w-fit @4xl/main:hidden",size:"sm",id:"view-selector",children:s.jsx(ni,{placeholder:"Select a view"})}),s.jsx(si,{children:s.jsxs(ti,{children:[s.jsx(hn,{value:"all",children:"All Skills"}),s.jsx(hn,{value:"attention",children:"Needs Attention"}),s.jsx(hn,{value:"recent",children:"Recently Active"}),s.jsx(hn,{value:"ungraded",children:"Ungraded"})]})})]}),s.jsxs(fs,{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(_e,{value:"all",children:["All Skills ",s.jsx(U,{variant:"secondary",children:I.all})]}),s.jsxs(_e,{value:"attention",children:["Needs Attention"," ",I.attention>0&&s.jsx(U,{variant:"secondary",children:I.attention})]}),s.jsxs(_e,{value:"recent",children:["Recently Active"," ",I.recent>0&&s.jsx(U,{variant:"secondary",children:I.recent})]}),s.jsxs(_e,{value:"ungraded",children:["Ungraded"," ",I.ungraded>0&&s.jsx(U,{variant:"secondary",children:I.ungraded})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[r&&s.jsxs(Ys,{children:[s.jsxs(Xs,{render:s.jsx(ye,{variant:"outline",size:"sm"}),children:[s.jsx(Bo,{"data-icon":"inline-start",className:"size-3.5"}),n&&n!=="ALL"?n.charAt(0)+n.slice(1).toLowerCase():"Status",s.jsx(Rt,{"data-icon":"inline-end"})]}),s.jsx(Js,{align:"end",className:"w-40",children:s.jsx(ou,{value:n??"ALL",onValueChange:k=>r(k),children:[{label:"All",value:"ALL",icon:s.jsx(rr,{className:"size-3.5"})},{label:"Healthy",value:"HEALTHY",icon:s.jsx(nt,{className:"size-3.5 text-emerald-600"})},{label:"Warning",value:"WARNING",icon:s.jsx(Ot,{className:"size-3.5 text-amber-500"})},{label:"Critical",value:"CRITICAL",icon:s.jsx(Ue,{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(ss,{className:"size-3.5 text-muted-foreground/60"})}].map(k=>s.jsx(cu,{value:k.value,children:s.jsxs("span",{className:"flex items-center gap-2",children:[k.icon,k.label]})},k.value))})})]}),s.jsxs(Ys,{children:[s.jsxs(Xs,{render:s.jsx(ye,{variant:"outline",size:"sm"}),children:[s.jsx(Uo,{"data-icon":"inline-start"}),"Columns",s.jsx(Rt,{"data-icon":"inline-end"})]}),s.jsx(Js,{align:"end",className:"w-40",children:R.getAllColumns().filter(k=>typeof k.accessorFn<"u"&&k.getCanHide()).map(k=>s.jsx(lu,{className:"capitalize",checked:k.getIsVisible(),onCheckedChange:j=>k.toggleVisibility(!!j),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(tt,{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(sc,{collisionDetection:ac,modifiers:[ic],onDragEnd:q,sensors:N,id:F,children:s.jsxs(bn,{children:[s.jsx(vn,{className:"sticky top-0 z-10 bg-muted",children:R.getHeaderGroups().map(k=>s.jsx(De,{children:k.headers.map(j=>s.jsx(ce,{colSpan:j.colSpan,className:j.column.getCanSort()?"cursor-pointer select-none":"",onClick:j.column.getToggleSortingHandler(),children:s.jsxs("div",{className:"flex items-center gap-1",children:[j.isPlaceholder?null:fa(j.column.columnDef.header,j.getContext()),j.column.getIsSorted()==="asc"?" ↑":j.column.getIsSorted()==="desc"?" ↓":null]})},j.id))},k.id))}),s.jsx(jn,{className:"**:data-[slot=table-cell]:first:w-8",children:(O=R.getRowModel().rows)!=null&&O.length?s.jsx(lc,{items:L,strategy:oc,children:R.getRowModel().rows.map(k=>s.jsx(Vm,{row:k},k.id))}):s.jsx(De,{children:s.jsx(oe,{colSpan:E.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:[R.getFilteredSelectedRowModel().rows.length," of"," ",R.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(Zs,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),s.jsxs(ei,{value:`${R.getState().pagination.pageSize}`,onValueChange:k=>{R.setPageSize(Number(k))},items:[10,20,50,100].map(k=>({label:`${k}`,value:`${k}`})),children:[s.jsx(ri,{size:"sm",className:"w-20",id:"rows-per-page",children:s.jsx(ni,{placeholder:R.getState().pagination.pageSize})}),s.jsx(si,{side:"top",children:s.jsx(ti,{children:[10,20,50,100].map(k=>s.jsx(hn,{value:`${k}`,children:k},k))})})]})]}),R.getRowModel().rows.length>0&&s.jsxs("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",R.getState().pagination.pageIndex+1," of"," ",R.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:()=>R.setPageIndex(0),disabled:!R.getCanPreviousPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to first page"}),s.jsx(Ho,{})]}),s.jsxs(ye,{variant:"outline",className:"size-8",size:"icon",onClick:()=>R.previousPage(),disabled:!R.getCanPreviousPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to previous page"}),s.jsx(qo,{})]}),s.jsxs(ye,{variant:"outline",className:"size-8",size:"icon",onClick:()=>R.nextPage(),disabled:!R.getCanNextPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to next page"}),s.jsx(an,{})]}),s.jsxs(ye,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>R.setPageIndex(R.getPageCount()-1),disabled:!R.getCanNextPage(),children:[s.jsx("span",{className:"sr-only",children:"Go to last page"}),s.jsx($o,{})]})]})]})]})]})]})}const cr="";async function Km(){const e=await fetch(`${cr}/api/v2/overview`);if(!e.ok)throw new Error(`API error: ${e.status} ${e.statusText}`);return e.json()}async function Gm(e){const t=await fetch(`${cr}/api/v2/skills/${encodeURIComponent(e)}`);if(!t.ok)throw t.status===404?new ml(e):new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function Wm(e=20){const t=await fetch(`${cr}/api/v2/orchestrate-runs?limit=${e}`);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function Ym(){const e=await fetch(`${cr}/api/v2/doctor`);if(!e.ok)throw new Error(`API error: ${e.status} ${e.statusText}`);return e.json()}class ml extends Error{constructor(t){super(`Skill "${t}" not found`),this.name="NotFoundError"}}const Xm=3e4;function Jm(){return ir({queryKey:["orchestrate-runs"],queryFn:()=>Wm(20),staleTime:15e3,refetchInterval:Xm})}function Zm(e){return Ia(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:ps(t.pass_rate,t.total_checks),hasEvidence:t.has_evidence,uniqueSessions:t.unique_sessions,lastSeen:t.last_seen})))}function ex({skillCount:e}){const[t,n]=M.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(rr,{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(aa,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})}function tx({search:e,statusFilter:t,onStatusFilterChange:n,overviewQuery:r}){const{data:i,isPending:a,isError:l,error:o,refetch:c}=r,u=Jm(),d=M.useMemo(()=>i?Zm(i.skills):[],[i]),h=M.useMemo(()=>{let v=d;if(e){const y=e.toLowerCase();v=v.filter(C=>C.name.toLowerCase().includes(y))}return t!=="ALL"&&(v=v.filter(y=>y.status===t)),v},[d,e,t]);if(a)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((v,y)=>s.jsx(Ke,{className:"h-24 rounded-xl"},y))}),s.jsxs("div",{className:"px-4 lg:px-6",children:[s.jsx(Ke,{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((v,y)=>s.jsx(Ke,{className:"h-28 rounded-xl"},y))})]})]});if(l)return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-16",children:[s.jsx(sr,{className:"size-10 text-destructive"}),s.jsx("p",{className:"text-sm font-medium text-destructive",children:o instanceof Error?o.message:"Unknown error"}),s.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>c(),children:[s.jsx(Kn,{className:"mr-2 size-3.5"}),"Retry"]})]});if(!i)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:p,skills:f}=i,b=f.filter(v=>v.total_checks>=5),w=b.length>0?b.reduce((v,y)=>v+y.pass_rate,0)/b.length:null;return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 py-6",children:[s.jsx(ex,{skillCount:f.length}),s.jsx(Hm,{skillsCount:f.length,avgPassRate:w,unmatchedCount:p.unmatched_queries.length,sessionsCount:p.counts.sessions,pendingCount:p.pending_proposals.length,evidenceCount:p.counts.evidence}),s.jsxs("div",{className:"grid grid-cols-1 gap-6 @5xl/main:grid-cols-[1fr_320px]",children:[s.jsx(Qm,{cards:h,totalCount:d.length,statusFilter:t,onStatusFilterChange:n,renderSkillName:v=>s.jsx(qt,{to:`/skills/${encodeURIComponent(v.name)}`,className:"text-sm font-medium hover:underline",children:v.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(Yu,{evolution:p.evolution,pendingProposals:p.pending_proposals,unmatchedQueries:p.unmatched_queries}),u.isPending?s.jsx(Ke,{className:"h-32 rounded-xl"}):u.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(Um,{runs:u.data.runs})]})})]})]})}function nx(e){return ir({queryKey:["skill-report",e],queryFn:()=>Gm(e),enabled:!!e,staleTime:3e4,retry:(t,n)=>n instanceof ml?!1:t<2})}function Gi(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 rx={created:"outline",validated:"secondary",deployed:"default",rejected:"destructive",rolled_back:"destructive"};function sx(){var q,O,k;const{name:e}=Cl(),{data:t,isPending:n,isError:r,error:i,refetch:a}=nx(e),[l,o]=M.useState(null);if(M.useEffect(()=>{o(null)},[e]),!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(n)return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 p-4 lg:p-6",children:[s.jsx(Ke,{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((j,_)=>s.jsx(Ke,{className:"h-24 rounded-xl"},_))}),s.jsx(Ke,{className:"h-20 rounded-xl"}),s.jsx(Ke,{className:"h-64 rounded-xl"})]});if(r)return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-16",children:[s.jsx(sr,{className:"size-10 text-destructive"}),s.jsx("p",{className:"text-sm font-medium text-destructive",children:i instanceof Error?i.message:"Unknown error"}),s.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>a(),children:[s.jsx(Kn,{className:"mr-2 size-3.5"}),"Retry"]})]});if(!t)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(t.usage.total_checks===0&&t.usage.triggered_count===0&&t.evidence.length===0&&t.evolution.length===0&&t.pending_proposals.length===0&&t.recent_invocations.length===0&&(((q=t.canonical_invocations)==null?void 0:q.length)??0)===0&&(((O=t.prompt_samples)==null?void 0:O.length)??0)===0&&(((k=t.session_metadata)==null?void 0:k.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(qt,{to:"/"}),children:[s.jsx(Qo,{className:"mr-2 size-3.5"}),"Back to Overview"]})]});const{usage:u,recent_invocations:d,evidence:h,evolution:p,pending_proposals:f,canonical_invocations:b,duration_stats:w,selftune_stats:v,prompt_samples:y,session_metadata:C}=t,E=ps(u.pass_rate,u.total_checks),I=qr[E]??qr.UNKNOWN,F=E==="HEALTHY",N=l??(p.length>0?p[0].proposal_id:null),R=[...new Set((C??[]).map(j=>j.model).filter(Boolean))],L=[...new Set((C??[]).map(j=>j.platform).filter(Boolean))],B=[...new Set((C??[]).map(j=>j.branch).filter(Boolean))];return s.jsx(hs,{defaultValue:p.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:t.skill_name}),s.jsxs(U,{variant:I.variant,className:"gap-1 shrink-0 text-[10px]",children:[I.icon,I.label]}),s.jsxs(fs,{variant:"line",className:"ml-auto",children:[p.length>0&&s.jsxs(jt,{children:[s.jsxs(wt,{render:s.jsx(_e,{value:"evidence"}),children:["Evidence",N&&s.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:["#",N.slice(0,8)]})]}),s.jsx(Nt,{children:"Change history and validation results"})]}),s.jsxs(jt,{children:[s.jsxs(wt,{render:s.jsx(_e,{value:"invocations"}),children:["Invocations",s.jsx(U,{variant:"secondary",className:"text-[10px]",children:d.length})]}),s.jsx(Nt,{children:"Recent skill triggers and their outcomes"})]}),y&&y.length>0&&s.jsxs(jt,{children:[s.jsxs(wt,{render:s.jsx(_e,{value:"prompts"}),children:["Prompts",s.jsx(U,{variant:"secondary",className:"text-[10px]",children:y.length})]}),s.jsx(Nt,{children:"User inputs that matched this skill"})]}),C&&C.length>0&&s.jsxs(jt,{children:[s.jsxs(wt,{render:s.jsx(_e,{value:"sessions"}),children:["Sessions",s.jsx(U,{variant:"secondary",className:"text-[10px]",children:C.length})]}),s.jsx(Nt,{children:"Environment and runtime information"})]}),f.length>0&&s.jsxs(jt,{children:[s.jsxs(wt,{render:s.jsx(_e,{value:"pending"}),children:["Pending",s.jsx(U,{variant:"destructive",className:"text-[10px]",children:f.length})]}),s.jsx(Nt,{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(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(ha,{className:"size-3.5"}),"Pass Rate",s.jsx(ge,{text:"Percentage of eval test cases that passed for this skill"})]}),s.jsx(te,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${F?"":"text-red-600"}`,children:xt(u.pass_rate)}),s.jsx(pt,{children:s.jsxs(U,{variant:F?"outline":"destructive",children:[F?s.jsx(tr,{className:"size-3"}):s.jsx(nr,{className:"size-3"}),xt(u.pass_rate)]})})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(rr,{className:"size-3.5"}),"Total Checks",s.jsx(ge,{text:"Total evaluation checks run across all sessions for this skill"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:u.total_checks})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(sn,{className:"size-3.5"}),"Triggered",s.jsx(ge,{text:"Number of times this skill was invoked by the agent during sessions"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:u.triggered_count})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(ls,{className:"size-3.5"}),"Sessions",s.jsx(ge,{text:"Number of unique agent sessions where this skill was present"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:t.sessions_with_skill})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(Ko,{className:"size-3.5"}),"LLM Calls",s.jsx(ge,{text:"Total LLM calls made by selftune when evolving this skill"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:(v==null?void 0:v.total_llm_calls)??0}),s.jsx(pt,{children:s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[(v==null?void 0:v.run_count)??0," evolution runs"]})})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(is,{className:"size-3.5"}),"Avg Duration",s.jsx(ge,{text:"Average time selftune spent evolving this skill per run"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:Gi((v==null?void 0:v.avg_elapsed_ms)??0)}),s.jsx(pt,{children:s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[Gi((v==null?void 0:v.total_elapsed_ms)??0)," total"]})})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(Go,{className:"size-3.5"}),"Errors",s.jsx(ge,{text:"Total errors encountered during skill execution"})]}),s.jsx(te,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${((w==null?void 0:w.total_errors)??0)>0?"text-red-600":""}`,children:(w==null?void 0:w.total_errors)??0})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(Wo,{className:"size-3.5"}),"Avg Confidence",s.jsx(ge,{text:"Average model confidence score when routing user prompts to this skill"})]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:(()=>{const j=(b==null?void 0:b.filter(_=>_.confidence!==null))??[];return j.length>0?xt(j.reduce((_,z)=>_+(z.confidence??0),0)/j.length):"--"})()})]})})]}),s.jsxs("div",{className:"flex gap-6",children:[p.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(Lm,{entries:p,selectedProposalId:N,onSelect:o})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[p.length>0&&s.jsx(tt,{value:"evidence",children:N?s.jsx(Im,{proposalId:N,evolution:p,evidence:h}):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(tt,{value:"invocations",children:s.jsxs(Z,{children:[s.jsxs(ee,{children:[s.jsx(te,{className:"text-sm",children:"Recent Invocations"}),s.jsxs(ie,{children:[d.length," usage records",b&&b.length>0&&s.jsxs(s.Fragment,{children:[" · ",b.length," canonical"]})]})]}),s.jsx(Be,{children:b&&b.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(bn,{children:[s.jsx(vn,{children:s.jsxs(De,{children:[s.jsx(ce,{children:"Time"}),s.jsx(ce,{children:"Mode"}),s.jsx(ce,{children:"Triggered"}),s.jsx(ce,{children:"Confidence"}),s.jsx(ce,{children:"Tool"})]})}),s.jsx(jn,{children:b.map((j,_)=>s.jsxs(De,{className:j.triggered?"":"bg-red-50/50 dark:bg-red-950/30",children:[s.jsx(oe,{className:"whitespace-nowrap font-mono text-xs text-muted-foreground",children:be(j.timestamp)}),s.jsx(oe,{children:j.invocation_mode&&s.jsx(U,{variant:"secondary",className:"text-[10px]",children:j.invocation_mode})}),s.jsx(oe,{children:s.jsx(U,{variant:j.triggered?"outline":"destructive",className:"text-[10px]",children:j.triggered?"Yes":"No"})}),s.jsx(oe,{className:"font-mono text-xs text-muted-foreground",children:j.confidence!==null?`${Math.round(j.confidence*100)}%`:"--"}),s.jsx(oe,{className:"font-mono text-xs text-muted-foreground truncate max-w-[150px]",children:j.tool_name??"--"})]},`${j.session_id}-${_}`))})]})}):d.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No invocation records yet."}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(bn,{children:[s.jsx(vn,{children:s.jsxs(De,{children:[s.jsx(ce,{children:"Time"}),s.jsx(ce,{children:"Query"}),s.jsx(ce,{children:"Triggered"}),s.jsx(ce,{children:"Source"})]})}),s.jsx(jn,{children:d.map((j,_)=>s.jsxs(De,{className:j.triggered?"":"bg-red-50/50 dark:bg-red-950/30",children:[s.jsx(oe,{className:"whitespace-nowrap font-mono text-xs text-muted-foreground",children:be(j.timestamp)}),s.jsx(oe,{className:"max-w-[500px] truncate",children:j.query}),s.jsx(oe,{children:s.jsx(U,{variant:j.triggered?"outline":"destructive",className:"text-[10px]",children:j.triggered?"Yes":"No"})}),s.jsx(oe,{className:"font-mono text-xs text-muted-foreground",children:j.source??"--"})]},`${j.session_id}-${_}`))})]})})})]})}),y&&y.length>0&&s.jsx(tt,{value:"prompts",children:s.jsxs(Z,{children:[s.jsxs(ee,{children:[s.jsxs(te,{className:"text-sm flex items-center gap-1.5",children:[s.jsx(Yo,{className:"size-3.5"}),"User Prompts"]}),s.jsx(ie,{children:"Prompts from sessions that invoked this skill"})]}),s.jsx(Be,{children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(bn,{children:[s.jsx(vn,{children:s.jsxs(De,{children:[s.jsx(ce,{children:"Time"}),s.jsx(ce,{children:"Prompt"}),s.jsx(ce,{children:"Kind"}),s.jsx(ce,{children:"Actionable"})]})}),s.jsx(jn,{children:y.map((j,_)=>s.jsxs(De,{children:[s.jsx(oe,{className:"whitespace-nowrap font-mono text-xs text-muted-foreground",children:be(j.occurred_at)}),s.jsx(oe,{className:"max-w-[500px]",children:s.jsx("p",{className:"text-xs line-clamp-3",children:j.prompt_text})}),s.jsx(oe,{children:j.prompt_kind&&s.jsx(U,{variant:"secondary",className:"text-[10px]",children:j.prompt_kind})}),s.jsx(oe,{children:s.jsx(U,{variant:j.is_actionable?"outline":"secondary",className:"text-[10px]",children:j.is_actionable?"Yes":"No"})})]},`${j.session_id}-${_}`))})]})})})]})}),C&&C.length>0&&s.jsx(tt,{value:"sessions",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap gap-3",children:[R.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 bg-card",children:[s.jsx(Xo,{className:"size-3 text-muted-foreground"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Models:"}),R.map(j=>s.jsx(U,{variant:"secondary",className:"text-[10px]",children:j},j))]}),L.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 bg-card",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Platforms:"}),L.map(j=>s.jsx(U,{variant:"secondary",className:"text-[10px]",children:j},j))]}),B.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 bg-card",children:[s.jsx(Jo,{className:"size-3 text-muted-foreground"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Branches:"}),B.map(j=>s.jsx(U,{variant:"secondary",className:"text-[10px] font-mono",children:j},j))]})]}),s.jsxs(Z,{children:[s.jsxs(ee,{children:[s.jsx(te,{className:"text-sm",children:"Session Details"}),s.jsxs(ie,{children:[C.length," sessions"]})]}),s.jsx(Be,{children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(bn,{children:[s.jsx(vn,{children:s.jsxs(De,{children:[s.jsx(ce,{children:"Started"}),s.jsx(ce,{children:"Model"}),s.jsx(ce,{children:"Platform"}),s.jsx(ce,{children:"Agent"}),s.jsx(ce,{children:"Branch"}),s.jsx(ce,{children:"Status"})]})}),s.jsx(jn,{children:C.map(j=>s.jsxs(De,{children:[s.jsx(oe,{className:"whitespace-nowrap font-mono text-xs text-muted-foreground",children:j.started_at?be(j.started_at):"--"}),s.jsx(oe,{className:"text-xs",children:j.model?s.jsx(U,{variant:"secondary",className:"text-[10px]",children:j.model}):"--"}),s.jsx(oe,{className:"text-xs text-muted-foreground",children:j.platform??"--"}),s.jsx(oe,{className:"font-mono text-xs text-muted-foreground truncate max-w-[120px]",children:j.agent_cli??"--"}),s.jsx(oe,{className:"font-mono text-xs text-muted-foreground truncate max-w-[120px]",children:j.branch??"--"}),s.jsx(oe,{children:j.completion_status&&s.jsx(U,{variant:j.completion_status==="success"?"outline":j.completion_status==="error"?"destructive":"secondary",className:"text-[10px]",children:j.completion_status})})]},j.session_id))})]})})})]})]})}),f.length>0&&s.jsx(tt,{value:"pending",children:s.jsxs(Z,{children:[s.jsxs(ee,{children:[s.jsx(te,{className:"text-sm",children:"Pending Proposals"}),s.jsxs(ie,{children:[f.length," awaiting review"]})]}),s.jsx(Be,{className:"space-y-3",children:f.map(j=>s.jsxs("button",{type:"button",onClick:()=>o(j.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(U,{variant:rx[j.action]??"secondary",className:"text-[10px]",children:j.action}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:be(j.timestamp)}),s.jsxs("span",{className:"text-[10px] text-muted-foreground/60 font-mono ml-auto",children:["#",j.proposal_id.slice(0,8)]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:j.details})]})]},j.proposal_id))})]})})]})]})]})})}const ix=3e4;function ax(){return ir({queryKey:["doctor"],queryFn:Ym,staleTime:2e4,refetchInterval:ix})}const lx={pass:{icon:s.jsx(nt,{className:"size-4 text-emerald-600"}),variant:"outline",label:"Pass"},warn:{icon:s.jsx(Ot,{className:"size-4 text-amber-500"}),variant:"secondary",label:"Warning"},fail:{icon:s.jsx(Ue,{className:"size-4 text-red-500"}),variant:"destructive",label:"Fail"}},ox={config:{label:"Configuration",description:"selftune.json exists and contains valid agent_type and llm_mode",icon:s.jsx(ec,{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(gn,{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(gn,{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(gn,{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(gn,{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(Zo,{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(as,{className:"size-4 text-muted-foreground"})}};function cx({check:e}){const t=ox[e.name]??{label:e.name,description:"",icon:s.jsx(tc,{className:"size-4 text-muted-foreground"})},n=lx[e.status]??{icon:s.jsx(sr,{className:"size-4 text-muted-foreground"}),variant:"outline",label:e.status};return s.jsxs(Z,{children:[s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[t.icon,t.label,t.description&&s.jsx(ge,{text:t.description})]}),s.jsx(te,{className:"text-sm font-medium",children:e.message||"No details"}),s.jsx(pt,{children:s.jsxs(U,{variant:n.variant,className:"gap-1",children:[n.icon,n.label]})})]}),e.path&&s.jsx(Be,{className:"pt-0",children:s.jsx("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.path})})]})}function ux(){const{data:e,isPending:t,isError:n,error:r,refetch:i}=ax();if(t)return s.jsxs("div",{className:"@container/main flex flex-1 flex-col gap-6 p-4 lg:p-6",children:[s.jsx(Ke,{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((C,E)=>s.jsx(Ke,{className:"h-24 rounded-xl"},E))})]});if(n)return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-16",children:[s.jsx(sr,{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(Kn,{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.filter(C=>C.name==="config"),p=u.filter(C=>C.name.startsWith("log_")),f=u.filter(C=>C.name==="hook_settings"),b=u.filter(C=>C.name==="evolution_audit"),w=new Set(["config",...p.map(C=>C.name),"hook_settings","evolution_audit"]),v=u.filter(C=>!w.has(C.name)),y=[{title:"Configuration",checks:h},{title:"Log Files",checks:p},{title:"Hooks",checks:f},{title:"Evolution",checks:b},{title:"Other",checks:v}].filter(C=>C.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(la,{className:"size-5 text-muted-foreground"}),s.jsx("h1",{className:"text-base font-semibold tracking-tight lg:text-lg",children:"System Status"}),s.jsxs(U,{variant:o?"outline":"destructive",className:"gap-1",children:[o?s.jsx(nt,{className:"size-3 text-emerald-600"}):s.jsx(Ue,{className:"size-3"}),o?"Healthy":"Unhealthy"]}),s.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:["Last checked ",c?be(c):"—"]}),s.jsx(ye,{"aria-label":"Refresh status",title:"Refresh status",variant:"ghost",size:"sm",onClick:()=>i(),className:"shrink-0",children:s.jsx(Kn,{className:"size-3.5"})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 px-0",children:[s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(nt,{className:"size-3.5 text-emerald-600"}),"Passed"]}),s.jsx(te,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:d.pass})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(Ot,{className:"size-3.5 text-amber-500"}),"Warnings"]}),s.jsx(te,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${d.warn>0?"text-amber-500":""}`,children:d.warn})]})}),s.jsx(Z,{className:"@container/card",children:s.jsxs(ee,{children:[s.jsxs(ie,{className:"flex items-center gap-1.5",children:[s.jsx(Ue,{className:"size-3.5 text-red-500"}),"Failed"]}),s.jsx(te,{className:`text-2xl font-semibold tabular-nums @[250px]/card:text-3xl ${d.fail>0?"text-red-600":""}`,children:d.fail})]})})]}),y.map(C=>s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:C.title}),s.jsx("div",{className:"grid grid-cols-1 gap-3 @xl/main:grid-cols-2",children:C.checks.map((E,I)=>s.jsx(cx,{check:E},`${E.name}-${I}`))})]},C.title))]})}const dx=15e3;function hx(){return ir({queryKey:["overview"],queryFn:Km,staleTime:1e4,refetchInterval:dx})}const fx=new Vc({defaultOptions:{queries:{refetchOnWindowFocus:!0,gcTime:300*1e3}}});function px(){return s.jsxs(s.Fragment,{children:[s.jsx(xs,{}),s.jsx(sx,{})]})}function mx(){return s.jsxs(s.Fragment,{children:[s.jsx(xs,{}),s.jsx(ux,{})]})}function xx(){const[e,t]=M.useState(""),[n,r]=M.useState("ALL"),i=hx(),{data:a}=i,l=M.useMemo(()=>a?Ia(a.skills.map(c=>({name:c.skill_name,scope:c.skill_scope,status:ps(c.pass_rate,c.total_checks),passRate:c.total_checks>0?c.pass_rate:null,checks:c.total_checks}))):[],[a]),o=M.useMemo(()=>{if(!e)return l;const c=e.toLowerCase();return l.filter(u=>u.name.toLowerCase().includes(c))},[l,e]);return s.jsxs(zu,{children:[s.jsx($u,{skills:o,search:e,onSearchChange:t,version:a==null?void 0:a.version}),s.jsx(Au,{children:s.jsxs(Il,{children:[s.jsx(dr,{path:"/",element:s.jsxs(s.Fragment,{children:[s.jsx(xs,{}),s.jsx(tx,{search:e,statusFilter:n,onStatusFilterChange:r,overviewQuery:i})]})}),s.jsx(dr,{path:"/skills/:name",element:s.jsx(px,{})}),s.jsx(dr,{path:"/status",element:s.jsx(mx,{})})]})})]})}function gx(){return s.jsx(Kc,{client:fx,children:s.jsx(El,{children:s.jsx(Ku,{defaultTheme:"dark",children:s.jsx(fu,{children:s.jsx(xx,{})})})})})}Tl.createRoot(document.getElementById("root")).render(s.jsx(M.StrictMode,{children:s.jsx(gx,{})}));