@mcpspec/server 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mcpspec/server
2
2
 
3
- HTTP server and web UI backend for [MCPSpec](https://www.npmjs.com/package/mcpspec). Provides a REST API, WebSocket real-time events, and serves the MCPSpec web dashboard.
3
+ HTTP server and web UI backend for [MCPSpec](https://www.npmjs.com/package/mcpspec) — the reliability platform for MCP servers. Provides a REST API, WebSocket real-time events, and serves the MCPSpec web dashboard.
4
4
 
5
5
  > **For CLI usage, install [`mcpspec`](https://www.npmjs.com/package/mcpspec) instead.** This package is for embedding the MCPSpec server in your own applications.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpspec/server",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,8 +28,8 @@
28
28
  "@hono/node-server": "^1.13.0",
29
29
  "sql.js": "^1.11.0",
30
30
  "ws": "^8.18.0",
31
- "@mcpspec/core": "1.2.1",
32
- "@mcpspec/shared": "1.2.1"
31
+ "@mcpspec/core": "1.2.2",
32
+ "@mcpspec/shared": "1.2.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^22.0.0",
@@ -263,7 +263,7 @@ Error generating stack: `+v.message+`
263
263
  *
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
- */const cj=Ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function G0(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=G0(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Y0(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=G0(e))&&(i&&(i+=" "),i+=t);return i}const Pp="-",uj=e=>{const t=fj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{const c=u.split(Pp);return c[0]===""&&c.length!==1&&c.shift(),X0(c,t)||dj(u)},getConflictingClassGroupIds:(u,c)=>{const h=n[u]||[];return c&&i[u]?[...h,...i[u]]:h}}},X0=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),o=i?X0(e.slice(1),i):void 0;if(o)return o;if(t.validators.length===0)return;const l=e.join(Pp);return(u=t.validators.find(({validator:c})=>c(l)))==null?void 0:u.classGroupId},Ry=/^\[(.+)\]$/,dj=e=>{if(Ry.test(e)){const t=Ry.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},fj=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return pj(Object.entries(e.classGroups),n).forEach(([l,u])=>{Wh(u,i,l,t)}),i},Wh=(e,t,n,i)=>{e.forEach(o=>{if(typeof o=="string"){const l=o===""?t:Ny(t,o);l.classGroupId=n;return}if(typeof o=="function"){if(hj(o)){Wh(o(i),t,n,i);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([l,u])=>{Wh(u,Ny(t,l),n,i)})})},Ny=(e,t)=>{let n=e;return t.split(Pp).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},hj=e=>e.isThemeGetter,pj=(e,t)=>t?e.map(([n,i])=>{const o=i.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([u,c])=>[t+u,c])):l);return[n,o]}):e,mj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,i=new Map;const o=(l,u)=>{n.set(l,u),t++,t>e&&(t=0,i=n,n=new Map)};return{get(l){let u=n.get(l);if(u!==void 0)return u;if((u=i.get(l))!==void 0)return o(l,u),u},set(l,u){n.has(l)?n.set(l,u):o(l,u)}}},J0="!",gj=e=>{const{separator:t,experimentalParseClassName:n}=e,i=t.length===1,o=t[0],l=t.length,u=c=>{const h=[];let m=0,g=0,y;for(let C=0;C<c.length;C++){let N=c[C];if(m===0){if(N===o&&(i||c.slice(C,C+l)===t)){h.push(c.slice(g,C)),g=C+l;continue}if(N==="/"){y=C;continue}}N==="["?m++:N==="]"&&m--}const x=h.length===0?c:c.substring(g),w=x.startsWith(J0),_=w?x.substring(1):x,S=y&&y>g?y-g:void 0;return{modifiers:h,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:S}};return n?c=>n({className:c,parseClassName:u}):u},vj=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(i=>{i[0]==="["?(t.push(...n.sort(),i),n=[]):n.push(i)}),t.push(...n.sort()),t},yj=e=>({cache:mj(e.cacheSize),parseClassName:gj(e),...uj(e)}),xj=/\s+/,wj=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o}=t,l=[],u=e.trim().split(xj);let c="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{modifiers:g,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:w}=n(m);let _=!!w,S=i(_?x.substring(0,w):x);if(!S){if(!_){c=m+(c.length>0?" "+c:c);continue}if(S=i(x),!S){c=m+(c.length>0?" "+c:c);continue}_=!1}const C=vj(g).join(":"),N=y?C+J0:C,k=N+S;if(l.includes(k))continue;l.push(k);const R=o(S,_);for(let j=0;j<R.length;++j){const P=R[j];l.push(N+P)}c=m+(c.length>0?" "+c:c)}return c};function Sj(){let e=0,t,n,i="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ew(t))&&(i&&(i+=" "),i+=n);return i}const ew=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=ew(e[i]))&&(n&&(n+=" "),n+=t);return n};function bj(e,...t){let n,i,o,l=u;function u(h){const m=t.reduce((g,y)=>y(g),e());return n=yj(m),i=n.cache.get,o=n.cache.set,l=c,c(h)}function c(h){const m=i(h);if(m)return m;const g=wj(h,n);return o(h,g),g}return function(){return l(Sj.apply(null,arguments))}}const Ct=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},tw=/^\[(?:([a-z-]+):)?(.+)\]$/i,Cj=/^\d+\/\d+$/,kj=new Set(["px","full","screen"]),_j=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ej=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Nj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,is=e=>Bo(e)||kj.has(e)||Cj.test(e),Ws=e=>ma(e,"length",Fj),Bo=e=>!!e&&!Number.isNaN(Number(e)),uh=e=>ma(e,"number",Bo),il=e=>!!e&&Number.isInteger(Number(e)),Pj=e=>e.endsWith("%")&&Bo(e.slice(0,-1)),He=e=>tw.test(e),Hs=e=>_j.test(e),Tj=new Set(["length","size","percentage"]),Oj=e=>ma(e,Tj,nw),Aj=e=>ma(e,"position",nw),Ij=new Set(["image","url"]),Mj=e=>ma(e,Ij,zj),Lj=e=>ma(e,"",Dj),ol=()=>!0,ma=(e,t,n)=>{const i=tw.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},Fj=e=>jj.test(e)&&!Ej.test(e),nw=()=>!1,Dj=e=>Rj.test(e),zj=e=>Nj.test(e),Vj=()=>{const e=Ct("colors"),t=Ct("spacing"),n=Ct("blur"),i=Ct("brightness"),o=Ct("borderColor"),l=Ct("borderRadius"),u=Ct("borderSpacing"),c=Ct("borderWidth"),h=Ct("contrast"),m=Ct("grayscale"),g=Ct("hueRotate"),y=Ct("invert"),x=Ct("gap"),w=Ct("gradientColorStops"),_=Ct("gradientColorStopPositions"),S=Ct("inset"),C=Ct("margin"),N=Ct("opacity"),k=Ct("padding"),R=Ct("saturate"),j=Ct("scale"),P=Ct("sepia"),T=Ct("skew"),O=Ct("space"),L=Ct("translate"),V=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto",He,t],W=()=>[He,t],ee=()=>["",is,Ws],se=()=>["auto",Bo,He],oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",He],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[Bo,He];return{cacheSize:500,separator:":",theme:{colors:[ol],spacing:[is,Ws],blur:["none","",Hs,He],brightness:I(),borderColor:[e],borderRadius:["none","","full",Hs,He],borderSpacing:W(),borderWidth:ee(),contrast:I(),grayscale:U(),hueRotate:I(),invert:U(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[Pj,Ws],inset:Z(),margin:Z(),opacity:I(),padding:W(),saturate:I(),scale:I(),sepia:U(),skew:I(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[Hs]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...oe(),He]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",il,He]}],basis:[{basis:Z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",il,He]}],"grid-cols":[{"grid-cols":[ol]}],"col-start-end":[{col:["auto",{span:["full",il,He]},He]}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":[ol]}],"row-start-end":[{row:["auto",{span:[il,He]},He]}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,t]}],"min-w":[{"min-w":[He,t,"min","max","fit"]}],"max-w":[{"max-w":[He,t,"none","full","min","max","fit","prose",{screen:[Hs]},Hs]}],h:[{h:[He,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hs,Ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uh]}],"font-family":[{font:[ol]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",He]}],"line-clamp":[{"line-clamp":["none",Bo,uh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",is,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",is,Ws]}],"underline-offset":[{"underline-offset":["auto",is,He]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...oe(),Aj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Oj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Mj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:X()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[is,He]}],"outline-w":[{outline:[is,Ws]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[is,Ws]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hs,Lj]}],"shadow-color":[{shadow:[ol]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...ie(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ie()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",Hs,He]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[y]}],saturate:[{saturate:[R]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[il,He]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[is,Ws,uh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},$j=bj(Vj);function pt(...e){return $j(Y0(e))}const Py=e=>{let t;const n=new Set,i=(m,g)=>{const y=typeof m=="function"?m(t):m;if(!Object.is(y,t)){const x=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(w=>w(t,x))}},o=()=>t,c={setState:i,getState:o,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m))},h=t=e(i,o,c);return c},Bj=(e=>e?Py(e):Py),Uj=e=>e;function Wj(e,t=Uj){const n=at.useSyncExternalStore(e.subscribe,at.useCallback(()=>t(e.getState()),[e,t]),at.useCallback(()=>t(e.getInitialState()),[e,t]));return at.useDebugValue(n),n}const Ty=e=>{const t=Bj(e),n=i=>Wj(t,i);return Object.assign(n,t),n},Hj=(e=>e?Ty(e):Ty);function Oy(e){e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}const Hh=Hj(e=>({sidebarCollapsed:!1,darkMode:!1,toggleSidebar:()=>e(t=>({sidebarCollapsed:!t.sidebarCollapsed})),toggleDarkMode:()=>e(t=>{const n=!t.darkMode;return Oy(n),localStorage.setItem("mcpspec-theme",n?"dark":"light"),{darkMode:n}}),initTheme:()=>{const t=localStorage.getItem("mcpspec-theme");let n;t?n=t==="dark":n=window.matchMedia("(prefers-color-scheme: dark)").matches,Oy(n),e({darkMode:n})}})),Kj=[{href:"/",label:"Dashboard",icon:tj},{href:"/servers",label:"Servers",icon:H0},{href:"/collections",label:"Collections",icon:U0},{href:"/runs",label:"Runs",icon:Wr},{href:"/inspect",label:"Inspect",icon:sj},{href:"/recordings",label:"Recordings",icon:Z0},{href:"/audit",label:"Audit",icon:K0},{href:"/benchmark",label:"Benchmark",icon:q0},{href:"/docs",label:"Docs",icon:B0},{href:"/score",label:"Score",icon:Q0}];function Qj({currentPath:e,onNavigate:t}){const n=Hh(o=>o.darkMode),i=Hh(o=>o.toggleDarkMode);return d.jsxs("aside",{className:"flex h-full w-56 flex-col border-r bg-card",children:[d.jsx("div",{className:"flex h-14 items-center border-b px-4",children:d.jsx("h1",{className:"text-lg font-bold text-primary",children:"MCPSpec"})}),d.jsx("nav",{className:"flex-1 space-y-1 p-2",children:Kj.map(o=>{const l=e===o.href||o.href!=="/"&&e.startsWith(o.href);return d.jsxs("button",{onClick:()=>t(o.href),className:pt("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",l?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[d.jsx(o.icon,{className:"h-4 w-4"}),o.label]},o.href)})}),d.jsxs("div",{className:"border-t p-4",children:[d.jsxs("button",{onClick:i,className:"flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:[n?d.jsx(oj,{className:"h-4 w-4"}):d.jsx(nj,{className:"h-4 w-4"}),n?"Light Mode":"Dark Mode"]}),d.jsx("div",{className:"mt-2 px-3 text-xs text-muted-foreground",children:"v1.2.1"})]})]})}function qj({children:e,currentPath:t,onNavigate:n}){return d.jsxs("div",{className:"flex h-screen",children:[d.jsx(Qj,{currentPath:t,onNavigate:n}),d.jsx("main",{className:"flex-1 overflow-auto p-6",children:e})]})}const Ye=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:pt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ye.displayName="Card";const xt=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:pt("flex flex-col space-y-1.5 p-6",e),...t}));xt.displayName="CardHeader";const wt=b.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:pt("text-2xl font-semibold leading-none tracking-tight",e),...t}));wt.displayName="CardTitle";const Zj=b.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:pt("text-sm text-muted-foreground",e),...t}));Zj.displayName="CardDescription";const Xe=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:pt("p-6 pt-0",e),...t}));Xe.displayName="CardContent";function Ay(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tp(...e){return t=>{let n=!1;const i=e.map(o=>{const l=Ay(o,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():Ay(e[o],null)}}}}function It(...e){return b.useCallback(Tp(...e),e)}var Gj=Symbol.for("react.lazy"),ku=fp[" use ".trim().toString()];function Yj(e){return typeof e=="object"&&e!==null&&"then"in e}function rw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Gj&&"_payload"in e&&Yj(e._payload)}function Xj(e){const t=eE(e),n=b.forwardRef((i,o)=>{let{children:l,...u}=i;rw(l)&&typeof ku=="function"&&(l=ku(l._payload));const c=b.Children.toArray(l),h=c.find(nE);if(h){const m=h.props.children,g=c.map(y=>y===h?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:y);return d.jsx(t,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,g):null})}return d.jsx(t,{...u,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}var Jj=Xj("Slot");function eE(e){const t=b.forwardRef((n,i)=>{let{children:o,...l}=n;if(rw(o)&&typeof ku=="function"&&(o=ku(o._payload)),b.isValidElement(o)){const u=sE(o),c=rE(l,o.props);return o.type!==b.Fragment&&(c.ref=i?Tp(i,u):u),b.cloneElement(o,c)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tE=Symbol("radix.slottable");function nE(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tE}function rE(e,t){const n={...t};for(const i in t){const o=e[i],l=t[i];/^on[A-Z]/.test(i)?o&&l?n[i]=(...c)=>{const h=l(...c);return o(...c),h}:o&&(n[i]=o):i==="style"?n[i]={...o,...l}:i==="className"&&(n[i]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function sE(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Iy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,My=Y0,sw=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return My(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(m=>{const g=n==null?void 0:n[m],y=l==null?void 0:l[m];if(g===null)return null;const x=Iy(g)||Iy(y);return o[m][x]}),c=n&&Object.entries(n).reduce((m,g)=>{let[y,x]=g;return x===void 0||(m[y]=x),m},{}),h=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((m,g)=>{let{class:y,className:x,...w}=g;return Object.entries(w).every(_=>{let[S,C]=_;return Array.isArray(C)?C.includes({...l,...c}[S]):{...l,...c}[S]===C})?[...m,y,x]:m},[]);return My(e,u,h,n==null?void 0:n.class,n==null?void 0:n.className)},iE=sw("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Me=b.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,...o},l)=>{const u=i?Jj:"button";return d.jsx(u,{className:pt(iE({variant:t,size:n,className:e})),ref:l,...o})});Me.displayName="Button";const oE=sw("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800",warning:"border-transparent bg-yellow-100 text-yellow-800"}},defaultVariants:{variant:"default"}});function dt({className:e,variant:t,...n}){return d.jsx("div",{className:pt(oE({variant:t}),e),...n})}const aE="/api";async function Ke(e,t){const n=await fetch(`${aE}${e}`,{...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const i=await n.json().catch(()=>({message:n.statusText}));throw new Error(i.message??`Request failed: ${n.status}`)}return n.json()}const Je={servers:{list:()=>Ke("/servers"),get:e=>Ke(`/servers/${e}`),create:e=>Ke("/servers",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>Ke(`/servers/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>Ke(`/servers/${e}`,{method:"DELETE"}),test:e=>Ke(`/servers/${e}/test`,{method:"POST"})},collections:{list:()=>Ke("/collections"),get:e=>Ke(`/collections/${e}`),create:e=>Ke("/collections",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>Ke(`/collections/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>Ke(`/collections/${e}`,{method:"DELETE"}),validate:e=>Ke(`/collections/${e}/validate`,{method:"POST"})},runs:{list:e=>Ke(`/runs${e?`?limit=${e}`:""}`),get:e=>Ke(`/runs/${e}`),trigger:e=>Ke("/runs",{method:"POST",body:JSON.stringify(e)}),delete:e=>Ke(`/runs/${e}`,{method:"DELETE"})},inspect:{connect:e=>Ke("/inspect/connect",{method:"POST",body:JSON.stringify(e)}),tools:e=>Ke("/inspect/tools",{method:"POST",body:JSON.stringify({sessionId:e})}),call:(e,t,n)=>Ke("/inspect/call",{method:"POST",body:JSON.stringify({sessionId:e,tool:t,input:n})}),resources:e=>Ke("/inspect/resources",{method:"POST",body:JSON.stringify({sessionId:e})}),messages:(e,t)=>Ke("/inspect/messages",{method:"POST",body:JSON.stringify({sessionId:e,after:t})}),disconnect:e=>Ke("/inspect/disconnect",{method:"POST",body:JSON.stringify({sessionId:e})}),saveRecording:(e,t,n)=>Ke("/inspect/save-recording",{method:"POST",body:JSON.stringify({sessionId:e,name:t,description:n})})},recordings:{list:()=>Ke("/recordings"),get:e=>Ke(`/recordings/${e}`),save:e=>Ke("/recordings",{method:"POST",body:JSON.stringify(e)}),delete:e=>Ke(`/recordings/${e}`,{method:"DELETE"}),replay:(e,t)=>Ke(`/recordings/${e}/replay`,{method:"POST",body:JSON.stringify(t)})},audit:{start:e=>Ke("/audit/start",{method:"POST",body:JSON.stringify(e)}),dryRun:e=>Ke("/audit/dry-run",{method:"POST",body:JSON.stringify(e)}),status:e=>Ke(`/audit/status/${e}`),result:e=>Ke(`/audit/result/${e}`),stop:e=>Ke(`/audit/stop/${e}`,{method:"POST"})},benchmark:{start:e=>Ke("/benchmark/start",{method:"POST",body:JSON.stringify(e)}),status:e=>Ke(`/benchmark/status/${e}`),result:e=>Ke(`/benchmark/result/${e}`),tools:e=>Ke(`/benchmark/tools/${e}`),stop:e=>Ke(`/benchmark/stop/${e}`,{method:"POST"})},docs:{generate:e=>Ke("/docs/generate",{method:"POST",body:JSON.stringify(e)})},score:{calculate:e=>Ke("/score/calculate",{method:"POST",body:JSON.stringify(e)}),badge:e=>Ke("/score/badge",{method:"POST",body:JSON.stringify({score:e})})}};function Ml(){return Al({queryKey:["servers"],queryFn:()=>Je.servers.list()})}function lE(){const e=Kr();return _r({mutationFn:t=>Je.servers.create(t),onSuccess:()=>e.invalidateQueries({queryKey:["servers"]})})}function cE(){const e=Kr();return _r({mutationFn:t=>Je.servers.delete(t),onSuccess:()=>e.invalidateQueries({queryKey:["servers"]})})}function uE(){return _r({mutationFn:e=>Je.servers.test(e)})}function Op(){return Al({queryKey:["collections"],queryFn:()=>Je.collections.list()})}function dE(){const e=Kr();return _r({mutationFn:t=>Je.collections.create(t),onSuccess:()=>e.invalidateQueries({queryKey:["collections"]})})}function fE(){const e=Kr();return _r({mutationFn:({id:t,data:n})=>Je.collections.update(t,n),onSuccess:()=>e.invalidateQueries({queryKey:["collections"]})})}function hE(){const e=Kr();return _r({mutationFn:t=>Je.collections.delete(t),onSuccess:()=>e.invalidateQueries({queryKey:["collections"]})})}function pE(){return _r({mutationFn:e=>Je.collections.validate(e)})}function iw(e){return Al({queryKey:["runs",e],queryFn:()=>Je.runs.list(e),refetchInterval:5e3})}function mE(e){return Al({queryKey:["runs",e],queryFn:()=>Je.runs.get(e),enabled:!!e,refetchInterval:t=>{var i,o;return((o=(i=t.state.data)==null?void 0:i.data)==null?void 0:o.status)==="running"?2e3:!1}})}function ow(){const e=Kr();return _r({mutationFn:t=>Je.runs.trigger(t),onSuccess:()=>e.invalidateQueries({queryKey:["runs"]})})}function gE(){const e=Kr();return _r({mutationFn:t=>Je.runs.delete(t),onSuccess:()=>e.invalidateQueries({queryKey:["runs"]})})}function vE({status:e}){switch(e){case"completed":return d.jsxs(dt,{variant:"success",children:[d.jsx(Il,{className:"mr-1 h-3 w-3"}),"Completed"]});case"failed":return d.jsxs(dt,{variant:"destructive",children:[d.jsx(ha,{className:"mr-1 h-3 w-3"}),"Failed"]});case"running":return d.jsxs(dt,{variant:"warning",children:[d.jsx(Np,{className:"mr-1 h-3 w-3"}),"Running"]});default:return d.jsx(dt,{variant:"secondary",children:e})}}function yE(){var i,o,l,u,c;const e=Ml(),t=Op(),n=iw(5);return d.jsxs("div",{className:"space-y-6",children:[d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Dashboard"}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[d.jsxs(Ye,{children:[d.jsxs(xt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(wt,{className:"text-sm font-medium",children:"Servers"}),d.jsx(H0,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsx(Xe,{children:d.jsx("div",{className:"text-2xl font-bold",children:((i=e.data)==null?void 0:i.total)??0})})]}),d.jsxs(Ye,{children:[d.jsxs(xt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(wt,{className:"text-sm font-medium",children:"Collections"}),d.jsx(U0,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsx(Xe,{children:d.jsx("div",{className:"text-2xl font-bold",children:((o=t.data)==null?void 0:o.total)??0})})]}),d.jsxs(Ye,{children:[d.jsxs(xt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(wt,{className:"text-sm font-medium",children:"Test Runs"}),d.jsx(Wr,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsx(Xe,{children:d.jsx("div",{className:"text-2xl font-bold",children:((l=n.data)==null?void 0:l.total)??0})})]})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{className:"text-lg",children:"Quick Actions"})}),d.jsxs(Xe,{className:"flex flex-wrap gap-2",children:[d.jsx(Me,{size:"sm",onClick:()=>gs.navigate({to:"/servers"}),children:"Add Server"}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>gs.navigate({to:"/collections"}),children:"New Collection"}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>gs.navigate({to:"/inspect"}),children:"Inspect Server"})]})]}),d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{className:"text-lg",children:"Recent Runs"})}),d.jsx(Xe,{children:((u=n.data)==null?void 0:u.data.length)===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No test runs yet"}):d.jsx("div",{className:"space-y-2",children:(c=n.data)==null?void 0:c.data.map(h=>d.jsxs("div",{className:"flex items-center justify-between rounded-md border p-2 cursor-pointer hover:bg-muted/50",onClick:()=>gs.navigate({to:"/runs/$runId",params:{runId:h.id}}),children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium",children:h.collectionName}),d.jsx("p",{className:"text-xs text-muted-foreground",children:h.duration?`${h.duration}ms`:"In progress..."})]}),d.jsx(vE,{status:h.status})]},h.id))})})]})]})]})}const qu=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{ref:n,className:pt("w-full caption-bottom text-sm",e),...t})}));qu.displayName="Table";const Zu=b.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:pt("[&_tr]:border-b",e),...t}));Zu.displayName="TableHeader";const Gu=b.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:pt("[&_tr:last-child]:border-0",e),...t}));Gu.displayName="TableBody";const no=b.forwardRef(({className:e,...t},n)=>d.jsx("tr",{ref:n,className:pt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));no.displayName="TableRow";const cn=b.forwardRef(({className:e,...t},n)=>d.jsx("th",{ref:n,className:pt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));cn.displayName="TableHead";const un=b.forwardRef(({className:e,...t},n)=>d.jsx("td",{ref:n,className:pt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));un.displayName="TableCell";function nt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function xE(e,t){const n=b.createContext(t),i=l=>{const{children:u,...c}=l,h=b.useMemo(()=>c,Object.values(c));return d.jsx(n.Provider,{value:h,children:u})};i.displayName=e+"Provider";function o(l){const u=b.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[i,o]}function ga(e,t=[]){let n=[];function i(l,u){const c=b.createContext(u),h=n.length;n=[...n,u];const m=y=>{var N;const{scope:x,children:w,..._}=y,S=((N=x==null?void 0:x[e])==null?void 0:N[h])||c,C=b.useMemo(()=>_,Object.values(_));return d.jsx(S.Provider,{value:C,children:w})};m.displayName=l+"Provider";function g(y,x){var S;const w=((S=x==null?void 0:x[e])==null?void 0:S[h])||c,_=b.useContext(w);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${l}\``)}return[m,g]}const o=()=>{const l=n.map(u=>b.createContext(u));return function(c){const h=(c==null?void 0:c[e])||l;return b.useMemo(()=>({[`__scope${e}`]:{...c,[e]:h}}),[c,h])}};return o.scopeName=e,[i,wE(o,...t)]}function wE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=i.reduce((c,{useScope:h,scopeName:m})=>{const y=h(l)[`__scope${m}`];return{...c,...y}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var dn=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},SE=fp[" useId ".trim().toString()]||(()=>{}),bE=0;function fi(e){const[t,n]=b.useState(SE());return dn(()=>{n(i=>i??String(bE++))},[e]),t?`radix-${t}`:""}var CE=fp[" useInsertionEffect ".trim().toString()]||dn;function yl({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[o,l,u]=kE({defaultProp:t,onChange:n}),c=e!==void 0,h=c?e:o;{const g=b.useRef(e!==void 0);b.useEffect(()=>{const y=g.current;y!==c&&console.warn(`${i} is changing from ${y?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=c},[c,i])}const m=b.useCallback(g=>{var y;if(c){const x=_E(g)?g(e):g;x!==e&&((y=u.current)==null||y.call(u,x))}else l(g)},[c,e,l,u]);return[h,m]}function kE({defaultProp:e,onChange:t}){const[n,i]=b.useState(e),o=b.useRef(n),l=b.useRef(t);return CE(()=>{l.current=t},[t]),b.useEffect(()=>{var u;o.current!==n&&((u=l.current)==null||u.call(l,n),o.current=n)},[n,o]),[n,i,l]}function _E(e){return typeof e=="function"}function xl(e){const t=jE(e),n=b.forwardRef((i,o)=>{const{children:l,...u}=i,c=b.Children.toArray(l),h=c.find(RE);if(h){const m=h.props.children,g=c.map(y=>y===h?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:y);return d.jsx(t,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,g):null})}return d.jsx(t,{...u,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function jE(e){const t=b.forwardRef((n,i)=>{const{children:o,...l}=n;if(b.isValidElement(o)){const u=PE(o),c=NE(l,o.props);return o.type!==b.Fragment&&(c.ref=i?Tp(i,u):u),b.cloneElement(o,c)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EE=Symbol("radix.slottable");function RE(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EE}function NE(e,t){const n={...t};for(const i in t){const o=e[i],l=t[i];/^on[A-Z]/.test(i)?o&&l?n[i]=(...c)=>{const h=l(...c);return o(...c),h}:o&&(n[i]=o):i==="style"?n[i]={...o,...l}:i==="className"&&(n[i]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function PE(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var TE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ct=TE.reduce((e,t)=>{const n=xl(`Primitive.${t}`),i=b.forwardRef((o,l)=>{const{asChild:u,...c}=o,h=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...c,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function OE(e,t){e&&fa.flushSync(()=>e.dispatchEvent(t))}function pi(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}function AE(e,t=globalThis==null?void 0:globalThis.document){const n=pi(e);b.useEffect(()=>{const i=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var IE="DismissableLayer",Kh="dismissableLayer.update",ME="dismissableLayer.pointerDownOutside",LE="dismissableLayer.focusOutside",Ly,aw=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ap=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:c,...h}=e,m=b.useContext(aw),[g,y]=b.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=b.useState({}),_=It(t,O=>y(O)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(C),k=g?S.indexOf(g):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,j=k>=N,P=zE(O=>{const L=O.target,V=[...m.branches].some(M=>M.contains(L));!j||V||(o==null||o(O),u==null||u(O),O.defaultPrevented||c==null||c())},x),T=VE(O=>{const L=O.target;[...m.branches].some(M=>M.contains(L))||(l==null||l(O),u==null||u(O),O.defaultPrevented||c==null||c())},x);return AE(O=>{k===m.layers.size-1&&(i==null||i(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},x),b.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Ly=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),Fy(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Ly)}},[g,x,n,m]),b.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),Fy())},[g,m]),b.useEffect(()=>{const O=()=>w({});return document.addEventListener(Kh,O),()=>document.removeEventListener(Kh,O)},[]),d.jsx(ct.div,{...h,ref:_,style:{pointerEvents:R?j?"auto":"none":void 0,...e.style},onFocusCapture:nt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:nt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:nt(e.onPointerDownCapture,P.onPointerDownCapture)})});Ap.displayName=IE;var FE="DismissableLayerBranch",DE=b.forwardRef((e,t)=>{const n=b.useContext(aw),i=b.useRef(null),o=It(t,i);return b.useEffect(()=>{const l=i.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),d.jsx(ct.div,{...e,ref:o})});DE.displayName=FE;function zE(e,t=globalThis==null?void 0:globalThis.document){const n=pi(e),i=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const l=c=>{if(c.target&&!i.current){let h=function(){lw(ME,n,m,{discrete:!0})};const m={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);i.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",l),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function VE(e,t=globalThis==null?void 0:globalThis.document){const n=pi(e),i=b.useRef(!1);return b.useEffect(()=>{const o=l=>{l.target&&!i.current&&lw(LE,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Fy(){const e=new CustomEvent(Kh);document.dispatchEvent(e)}function lw(e,t,n,{discrete:i}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),i?OE(o,l):o.dispatchEvent(l)}var dh="focusScope.autoFocusOnMount",fh="focusScope.autoFocusOnUnmount",Dy={bubbles:!1,cancelable:!0},$E="FocusScope",Ip=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[c,h]=b.useState(null),m=pi(o),g=pi(l),y=b.useRef(null),x=It(t,S=>h(S)),w=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(i){let S=function(R){if(w.paused||!c)return;const j=R.target;c.contains(j)?y.current=j:qs(y.current,{select:!0})},C=function(R){if(w.paused||!c)return;const j=R.relatedTarget;j!==null&&(c.contains(j)||qs(y.current,{select:!0}))},N=function(R){if(document.activeElement===document.body)for(const P of R)P.removedNodes.length>0&&qs(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const k=new MutationObserver(N);return c&&k.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),k.disconnect()}}},[i,c,w.paused]),b.useEffect(()=>{if(c){Vy.add(w);const S=document.activeElement;if(!c.contains(S)){const N=new CustomEvent(dh,Dy);c.addEventListener(dh,m),c.dispatchEvent(N),N.defaultPrevented||(BE(QE(cw(c)),{select:!0}),document.activeElement===S&&qs(c))}return()=>{c.removeEventListener(dh,m),setTimeout(()=>{const N=new CustomEvent(fh,Dy);c.addEventListener(fh,g),c.dispatchEvent(N),N.defaultPrevented||qs(S??document.body,{select:!0}),c.removeEventListener(fh,g),Vy.remove(w)},0)}}},[c,m,g,w]);const _=b.useCallback(S=>{if(!n&&!i||w.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(C&&N){const k=S.currentTarget,[R,j]=UE(k);R&&j?!S.shiftKey&&N===j?(S.preventDefault(),n&&qs(R,{select:!0})):S.shiftKey&&N===R&&(S.preventDefault(),n&&qs(j,{select:!0})):N===k&&S.preventDefault()}},[n,i,w.paused]);return d.jsx(ct.div,{tabIndex:-1,...u,ref:x,onKeyDown:_})});Ip.displayName=$E;function BE(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(qs(i,{select:t}),document.activeElement!==n)return}function UE(e){const t=cw(e),n=zy(t,e),i=zy(t.reverse(),e);return[n,i]}function cw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zy(e,t){for(const n of e)if(!WE(n,{upTo:t}))return n}function WE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function HE(e){return e instanceof HTMLInputElement&&"select"in e}function qs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&HE(e)&&t&&e.select()}}var Vy=KE();function KE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$y(e,t),e.unshift(t)},remove(t){var n;e=$y(e,t),(n=e[0])==null||n.resume()}}}function $y(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function QE(e){return e.filter(t=>t.tagName!=="A")}var qE="Portal",Mp=b.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[o,l]=b.useState(!1);dn(()=>l(!0),[]);const u=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?w_.createPortal(d.jsx(ct.div,{...i,ref:t}),u):null});Mp.displayName=qE;function ZE(e,t){return b.useReducer((n,i)=>t[n][i]??n,e)}var Ll=e=>{const{present:t,children:n}=e,i=GE(t),o=typeof n=="function"?n({present:i.isPresent}):b.Children.only(n),l=It(i.ref,YE(o));return typeof n=="function"||i.isPresent?b.cloneElement(o,{ref:l}):null};Ll.displayName="Presence";function GE(e){const[t,n]=b.useState(),i=b.useRef(null),o=b.useRef(e),l=b.useRef("none"),u=e?"mounted":"unmounted",[c,h]=ZE(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const m=Xc(i.current);l.current=c==="mounted"?m:"none"},[c]),dn(()=>{const m=i.current,g=o.current;if(g!==e){const x=l.current,w=Xc(m);e?h("MOUNT"):w==="none"||(m==null?void 0:m.display)==="none"?h("UNMOUNT"):h(g&&x!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),dn(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,y=w=>{const S=Xc(i.current).includes(CSS.escape(w.animationName));if(w.target===t&&S&&(h("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=w=>{w.target===t&&(l.current=Xc(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(m=>{i.current=m?getComputedStyle(m):null,n(m)},[])}}function Xc(e){return(e==null?void 0:e.animationName)||"none"}function YE(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=0;function uw(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??By()),document.body.insertAdjacentElement("beforeend",e[1]??By()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function By(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zr=function(){return zr=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},zr.apply(this,arguments)};function dw(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function XE(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,l;i<o;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}var uu="right-scroll-bar-position",du="width-before-scroll-bar",JE="with-scroll-bars-hidden",eR="--removed-body-scroll-bar-size";function ph(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tR(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var o=n.value;o!==i&&(n.value=i,n.callback(i,o))}}}})[0];return n.callback=t,n.facade}var nR=typeof window<"u"?b.useLayoutEffect:b.useEffect,Uy=new WeakMap;function rR(e,t){var n=tR(null,function(i){return e.forEach(function(o){return ph(o,i)})});return nR(function(){var i=Uy.get(n);if(i){var o=new Set(i),l=new Set(e),u=n.current;o.forEach(function(c){l.has(c)||ph(c,null)}),l.forEach(function(c){o.has(c)||ph(c,u)})}Uy.set(n,e)},[e]),n}function sR(e){return e}function iR(e,t){t===void 0&&(t=sR);var n=[],i=!1,o={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var u=t(l,i);return n.push(u),function(){n=n.filter(function(c){return c!==u})}},assignSyncMedium:function(l){for(i=!0;n.length;){var u=n;n=[],u.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){i=!0;var u=[];if(n.length){var c=n;n=[],c.forEach(l),u=n}var h=function(){var g=u;u=[],g.forEach(l)},m=function(){return Promise.resolve().then(h)};m(),n={push:function(g){u.push(g),m()},filter:function(g){return u=u.filter(g),n}}}};return o}function oR(e){e===void 0&&(e={});var t=iR(null);return t.options=zr({async:!0,ssr:!1},e),t}var fw=function(e){var t=e.sideCar,n=dw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return b.createElement(i,zr({},n))};fw.isSideCarExport=!0;function aR(e,t){return e.useMedium(t),fw}var hw=oR(),mh=function(){},Yu=b.forwardRef(function(e,t){var n=b.useRef(null),i=b.useState({onScrollCapture:mh,onWheelCapture:mh,onTouchMoveCapture:mh}),o=i[0],l=i[1],u=e.forwardProps,c=e.children,h=e.className,m=e.removeScrollBar,g=e.enabled,y=e.shards,x=e.sideCar,w=e.noRelative,_=e.noIsolation,S=e.inert,C=e.allowPinchZoom,N=e.as,k=N===void 0?"div":N,R=e.gapMode,j=dw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=x,T=rR([n,t]),O=zr(zr({},j),o);return b.createElement(b.Fragment,null,g&&b.createElement(P,{sideCar:hw,removeScrollBar:m,shards:y,noRelative:w,noIsolation:_,inert:S,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:R}),u?b.cloneElement(b.Children.only(c),zr(zr({},O),{ref:T})):b.createElement(k,zr({},O,{className:h,ref:T}),c))});Yu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yu.classNames={fullWidth:du,zeroRight:uu};var lR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lR();return t&&e.setAttribute("nonce",t),e}function uR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cR())&&(uR(t,n),dR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hR=function(){var e=fR();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pw=function(){var e=hR(),t=function(n){var i=n.styles,o=n.dynamic;return e(i,o),null};return t},pR={left:0,top:0,right:0,gap:0},gh=function(e){return parseInt(e||"",10)||0},mR=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[gh(n),gh(i),gh(o)]},gR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pR;var t=mR(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},vR=pw(),Uo="data-scroll-locked",yR=function(e,t,n,i){var o=e.left,l=e.top,u=e.right,c=e.gap;return n===void 0&&(n="margin"),`
266
+ */const cj=Ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function G0(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=G0(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Y0(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=G0(e))&&(i&&(i+=" "),i+=t);return i}const Pp="-",uj=e=>{const t=fj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{const c=u.split(Pp);return c[0]===""&&c.length!==1&&c.shift(),X0(c,t)||dj(u)},getConflictingClassGroupIds:(u,c)=>{const h=n[u]||[];return c&&i[u]?[...h,...i[u]]:h}}},X0=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),o=i?X0(e.slice(1),i):void 0;if(o)return o;if(t.validators.length===0)return;const l=e.join(Pp);return(u=t.validators.find(({validator:c})=>c(l)))==null?void 0:u.classGroupId},Ry=/^\[(.+)\]$/,dj=e=>{if(Ry.test(e)){const t=Ry.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},fj=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return pj(Object.entries(e.classGroups),n).forEach(([l,u])=>{Wh(u,i,l,t)}),i},Wh=(e,t,n,i)=>{e.forEach(o=>{if(typeof o=="string"){const l=o===""?t:Ny(t,o);l.classGroupId=n;return}if(typeof o=="function"){if(hj(o)){Wh(o(i),t,n,i);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([l,u])=>{Wh(u,Ny(t,l),n,i)})})},Ny=(e,t)=>{let n=e;return t.split(Pp).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},hj=e=>e.isThemeGetter,pj=(e,t)=>t?e.map(([n,i])=>{const o=i.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([u,c])=>[t+u,c])):l);return[n,o]}):e,mj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,i=new Map;const o=(l,u)=>{n.set(l,u),t++,t>e&&(t=0,i=n,n=new Map)};return{get(l){let u=n.get(l);if(u!==void 0)return u;if((u=i.get(l))!==void 0)return o(l,u),u},set(l,u){n.has(l)?n.set(l,u):o(l,u)}}},J0="!",gj=e=>{const{separator:t,experimentalParseClassName:n}=e,i=t.length===1,o=t[0],l=t.length,u=c=>{const h=[];let m=0,g=0,y;for(let C=0;C<c.length;C++){let N=c[C];if(m===0){if(N===o&&(i||c.slice(C,C+l)===t)){h.push(c.slice(g,C)),g=C+l;continue}if(N==="/"){y=C;continue}}N==="["?m++:N==="]"&&m--}const x=h.length===0?c:c.substring(g),w=x.startsWith(J0),_=w?x.substring(1):x,S=y&&y>g?y-g:void 0;return{modifiers:h,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:S}};return n?c=>n({className:c,parseClassName:u}):u},vj=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(i=>{i[0]==="["?(t.push(...n.sort(),i),n=[]):n.push(i)}),t.push(...n.sort()),t},yj=e=>({cache:mj(e.cacheSize),parseClassName:gj(e),...uj(e)}),xj=/\s+/,wj=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o}=t,l=[],u=e.trim().split(xj);let c="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{modifiers:g,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:w}=n(m);let _=!!w,S=i(_?x.substring(0,w):x);if(!S){if(!_){c=m+(c.length>0?" "+c:c);continue}if(S=i(x),!S){c=m+(c.length>0?" "+c:c);continue}_=!1}const C=vj(g).join(":"),N=y?C+J0:C,k=N+S;if(l.includes(k))continue;l.push(k);const R=o(S,_);for(let j=0;j<R.length;++j){const P=R[j];l.push(N+P)}c=m+(c.length>0?" "+c:c)}return c};function Sj(){let e=0,t,n,i="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ew(t))&&(i&&(i+=" "),i+=n);return i}const ew=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=ew(e[i]))&&(n&&(n+=" "),n+=t);return n};function bj(e,...t){let n,i,o,l=u;function u(h){const m=t.reduce((g,y)=>y(g),e());return n=yj(m),i=n.cache.get,o=n.cache.set,l=c,c(h)}function c(h){const m=i(h);if(m)return m;const g=wj(h,n);return o(h,g),g}return function(){return l(Sj.apply(null,arguments))}}const Ct=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},tw=/^\[(?:([a-z-]+):)?(.+)\]$/i,Cj=/^\d+\/\d+$/,kj=new Set(["px","full","screen"]),_j=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ej=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Nj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,is=e=>Bo(e)||kj.has(e)||Cj.test(e),Ws=e=>ma(e,"length",Fj),Bo=e=>!!e&&!Number.isNaN(Number(e)),uh=e=>ma(e,"number",Bo),il=e=>!!e&&Number.isInteger(Number(e)),Pj=e=>e.endsWith("%")&&Bo(e.slice(0,-1)),He=e=>tw.test(e),Hs=e=>_j.test(e),Tj=new Set(["length","size","percentage"]),Oj=e=>ma(e,Tj,nw),Aj=e=>ma(e,"position",nw),Ij=new Set(["image","url"]),Mj=e=>ma(e,Ij,zj),Lj=e=>ma(e,"",Dj),ol=()=>!0,ma=(e,t,n)=>{const i=tw.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},Fj=e=>jj.test(e)&&!Ej.test(e),nw=()=>!1,Dj=e=>Rj.test(e),zj=e=>Nj.test(e),Vj=()=>{const e=Ct("colors"),t=Ct("spacing"),n=Ct("blur"),i=Ct("brightness"),o=Ct("borderColor"),l=Ct("borderRadius"),u=Ct("borderSpacing"),c=Ct("borderWidth"),h=Ct("contrast"),m=Ct("grayscale"),g=Ct("hueRotate"),y=Ct("invert"),x=Ct("gap"),w=Ct("gradientColorStops"),_=Ct("gradientColorStopPositions"),S=Ct("inset"),C=Ct("margin"),N=Ct("opacity"),k=Ct("padding"),R=Ct("saturate"),j=Ct("scale"),P=Ct("sepia"),T=Ct("skew"),O=Ct("space"),L=Ct("translate"),V=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto",He,t],W=()=>[He,t],ee=()=>["",is,Ws],se=()=>["auto",Bo,He],oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",He],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[Bo,He];return{cacheSize:500,separator:":",theme:{colors:[ol],spacing:[is,Ws],blur:["none","",Hs,He],brightness:I(),borderColor:[e],borderRadius:["none","","full",Hs,He],borderSpacing:W(),borderWidth:ee(),contrast:I(),grayscale:U(),hueRotate:I(),invert:U(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[Pj,Ws],inset:Z(),margin:Z(),opacity:I(),padding:W(),saturate:I(),scale:I(),sepia:U(),skew:I(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[Hs]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...oe(),He]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",il,He]}],basis:[{basis:Z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",il,He]}],"grid-cols":[{"grid-cols":[ol]}],"col-start-end":[{col:["auto",{span:["full",il,He]},He]}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":[ol]}],"row-start-end":[{row:["auto",{span:[il,He]},He]}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,t]}],"min-w":[{"min-w":[He,t,"min","max","fit"]}],"max-w":[{"max-w":[He,t,"none","full","min","max","fit","prose",{screen:[Hs]},Hs]}],h:[{h:[He,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hs,Ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uh]}],"font-family":[{font:[ol]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",He]}],"line-clamp":[{"line-clamp":["none",Bo,uh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",is,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",is,Ws]}],"underline-offset":[{"underline-offset":["auto",is,He]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...oe(),Aj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Oj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Mj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:X()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[is,He]}],"outline-w":[{outline:[is,Ws]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[is,Ws]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hs,Lj]}],"shadow-color":[{shadow:[ol]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...ie(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ie()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",Hs,He]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[y]}],saturate:[{saturate:[R]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[il,He]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[is,Ws,uh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},$j=bj(Vj);function pt(...e){return $j(Y0(e))}const Py=e=>{let t;const n=new Set,i=(m,g)=>{const y=typeof m=="function"?m(t):m;if(!Object.is(y,t)){const x=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(w=>w(t,x))}},o=()=>t,c={setState:i,getState:o,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m))},h=t=e(i,o,c);return c},Bj=(e=>e?Py(e):Py),Uj=e=>e;function Wj(e,t=Uj){const n=at.useSyncExternalStore(e.subscribe,at.useCallback(()=>t(e.getState()),[e,t]),at.useCallback(()=>t(e.getInitialState()),[e,t]));return at.useDebugValue(n),n}const Ty=e=>{const t=Bj(e),n=i=>Wj(t,i);return Object.assign(n,t),n},Hj=(e=>e?Ty(e):Ty);function Oy(e){e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}const Hh=Hj(e=>({sidebarCollapsed:!1,darkMode:!1,toggleSidebar:()=>e(t=>({sidebarCollapsed:!t.sidebarCollapsed})),toggleDarkMode:()=>e(t=>{const n=!t.darkMode;return Oy(n),localStorage.setItem("mcpspec-theme",n?"dark":"light"),{darkMode:n}}),initTheme:()=>{const t=localStorage.getItem("mcpspec-theme");let n;t?n=t==="dark":n=window.matchMedia("(prefers-color-scheme: dark)").matches,Oy(n),e({darkMode:n})}})),Kj=[{href:"/",label:"Dashboard",icon:tj},{href:"/servers",label:"Servers",icon:H0},{href:"/collections",label:"Collections",icon:U0},{href:"/runs",label:"Runs",icon:Wr},{href:"/inspect",label:"Inspect",icon:sj},{href:"/recordings",label:"Recordings",icon:Z0},{href:"/audit",label:"Audit",icon:K0},{href:"/benchmark",label:"Benchmark",icon:q0},{href:"/docs",label:"Docs",icon:B0},{href:"/score",label:"Score",icon:Q0}];function Qj({currentPath:e,onNavigate:t}){const n=Hh(o=>o.darkMode),i=Hh(o=>o.toggleDarkMode);return d.jsxs("aside",{className:"flex h-full w-56 flex-col border-r bg-card",children:[d.jsx("div",{className:"flex h-14 items-center border-b px-4",children:d.jsx("h1",{className:"text-lg font-bold text-primary",children:"MCPSpec"})}),d.jsx("nav",{className:"flex-1 space-y-1 p-2",children:Kj.map(o=>{const l=e===o.href||o.href!=="/"&&e.startsWith(o.href);return d.jsxs("button",{onClick:()=>t(o.href),className:pt("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",l?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[d.jsx(o.icon,{className:"h-4 w-4"}),o.label]},o.href)})}),d.jsxs("div",{className:"border-t p-4",children:[d.jsxs("button",{onClick:i,className:"flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:[n?d.jsx(oj,{className:"h-4 w-4"}):d.jsx(nj,{className:"h-4 w-4"}),n?"Light Mode":"Dark Mode"]}),d.jsx("div",{className:"mt-2 px-3 text-xs text-muted-foreground",children:"v1.2.2"})]})]})}function qj({children:e,currentPath:t,onNavigate:n}){return d.jsxs("div",{className:"flex h-screen",children:[d.jsx(Qj,{currentPath:t,onNavigate:n}),d.jsx("main",{className:"flex-1 overflow-auto p-6",children:e})]})}const Ye=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:pt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ye.displayName="Card";const xt=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:pt("flex flex-col space-y-1.5 p-6",e),...t}));xt.displayName="CardHeader";const wt=b.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:pt("text-2xl font-semibold leading-none tracking-tight",e),...t}));wt.displayName="CardTitle";const Zj=b.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:pt("text-sm text-muted-foreground",e),...t}));Zj.displayName="CardDescription";const Xe=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:pt("p-6 pt-0",e),...t}));Xe.displayName="CardContent";function Ay(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tp(...e){return t=>{let n=!1;const i=e.map(o=>{const l=Ay(o,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():Ay(e[o],null)}}}}function It(...e){return b.useCallback(Tp(...e),e)}var Gj=Symbol.for("react.lazy"),ku=fp[" use ".trim().toString()];function Yj(e){return typeof e=="object"&&e!==null&&"then"in e}function rw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Gj&&"_payload"in e&&Yj(e._payload)}function Xj(e){const t=eE(e),n=b.forwardRef((i,o)=>{let{children:l,...u}=i;rw(l)&&typeof ku=="function"&&(l=ku(l._payload));const c=b.Children.toArray(l),h=c.find(nE);if(h){const m=h.props.children,g=c.map(y=>y===h?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:y);return d.jsx(t,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,g):null})}return d.jsx(t,{...u,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}var Jj=Xj("Slot");function eE(e){const t=b.forwardRef((n,i)=>{let{children:o,...l}=n;if(rw(o)&&typeof ku=="function"&&(o=ku(o._payload)),b.isValidElement(o)){const u=sE(o),c=rE(l,o.props);return o.type!==b.Fragment&&(c.ref=i?Tp(i,u):u),b.cloneElement(o,c)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tE=Symbol("radix.slottable");function nE(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tE}function rE(e,t){const n={...t};for(const i in t){const o=e[i],l=t[i];/^on[A-Z]/.test(i)?o&&l?n[i]=(...c)=>{const h=l(...c);return o(...c),h}:o&&(n[i]=o):i==="style"?n[i]={...o,...l}:i==="className"&&(n[i]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function sE(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Iy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,My=Y0,sw=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return My(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(m=>{const g=n==null?void 0:n[m],y=l==null?void 0:l[m];if(g===null)return null;const x=Iy(g)||Iy(y);return o[m][x]}),c=n&&Object.entries(n).reduce((m,g)=>{let[y,x]=g;return x===void 0||(m[y]=x),m},{}),h=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((m,g)=>{let{class:y,className:x,...w}=g;return Object.entries(w).every(_=>{let[S,C]=_;return Array.isArray(C)?C.includes({...l,...c}[S]):{...l,...c}[S]===C})?[...m,y,x]:m},[]);return My(e,u,h,n==null?void 0:n.class,n==null?void 0:n.className)},iE=sw("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Me=b.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,...o},l)=>{const u=i?Jj:"button";return d.jsx(u,{className:pt(iE({variant:t,size:n,className:e})),ref:l,...o})});Me.displayName="Button";const oE=sw("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800",warning:"border-transparent bg-yellow-100 text-yellow-800"}},defaultVariants:{variant:"default"}});function dt({className:e,variant:t,...n}){return d.jsx("div",{className:pt(oE({variant:t}),e),...n})}const aE="/api";async function Ke(e,t){const n=await fetch(`${aE}${e}`,{...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const i=await n.json().catch(()=>({message:n.statusText}));throw new Error(i.message??`Request failed: ${n.status}`)}return n.json()}const Je={servers:{list:()=>Ke("/servers"),get:e=>Ke(`/servers/${e}`),create:e=>Ke("/servers",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>Ke(`/servers/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>Ke(`/servers/${e}`,{method:"DELETE"}),test:e=>Ke(`/servers/${e}/test`,{method:"POST"})},collections:{list:()=>Ke("/collections"),get:e=>Ke(`/collections/${e}`),create:e=>Ke("/collections",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>Ke(`/collections/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>Ke(`/collections/${e}`,{method:"DELETE"}),validate:e=>Ke(`/collections/${e}/validate`,{method:"POST"})},runs:{list:e=>Ke(`/runs${e?`?limit=${e}`:""}`),get:e=>Ke(`/runs/${e}`),trigger:e=>Ke("/runs",{method:"POST",body:JSON.stringify(e)}),delete:e=>Ke(`/runs/${e}`,{method:"DELETE"})},inspect:{connect:e=>Ke("/inspect/connect",{method:"POST",body:JSON.stringify(e)}),tools:e=>Ke("/inspect/tools",{method:"POST",body:JSON.stringify({sessionId:e})}),call:(e,t,n)=>Ke("/inspect/call",{method:"POST",body:JSON.stringify({sessionId:e,tool:t,input:n})}),resources:e=>Ke("/inspect/resources",{method:"POST",body:JSON.stringify({sessionId:e})}),messages:(e,t)=>Ke("/inspect/messages",{method:"POST",body:JSON.stringify({sessionId:e,after:t})}),disconnect:e=>Ke("/inspect/disconnect",{method:"POST",body:JSON.stringify({sessionId:e})}),saveRecording:(e,t,n)=>Ke("/inspect/save-recording",{method:"POST",body:JSON.stringify({sessionId:e,name:t,description:n})})},recordings:{list:()=>Ke("/recordings"),get:e=>Ke(`/recordings/${e}`),save:e=>Ke("/recordings",{method:"POST",body:JSON.stringify(e)}),delete:e=>Ke(`/recordings/${e}`,{method:"DELETE"}),replay:(e,t)=>Ke(`/recordings/${e}/replay`,{method:"POST",body:JSON.stringify(t)})},audit:{start:e=>Ke("/audit/start",{method:"POST",body:JSON.stringify(e)}),dryRun:e=>Ke("/audit/dry-run",{method:"POST",body:JSON.stringify(e)}),status:e=>Ke(`/audit/status/${e}`),result:e=>Ke(`/audit/result/${e}`),stop:e=>Ke(`/audit/stop/${e}`,{method:"POST"})},benchmark:{start:e=>Ke("/benchmark/start",{method:"POST",body:JSON.stringify(e)}),status:e=>Ke(`/benchmark/status/${e}`),result:e=>Ke(`/benchmark/result/${e}`),tools:e=>Ke(`/benchmark/tools/${e}`),stop:e=>Ke(`/benchmark/stop/${e}`,{method:"POST"})},docs:{generate:e=>Ke("/docs/generate",{method:"POST",body:JSON.stringify(e)})},score:{calculate:e=>Ke("/score/calculate",{method:"POST",body:JSON.stringify(e)}),badge:e=>Ke("/score/badge",{method:"POST",body:JSON.stringify({score:e})})}};function Ml(){return Al({queryKey:["servers"],queryFn:()=>Je.servers.list()})}function lE(){const e=Kr();return _r({mutationFn:t=>Je.servers.create(t),onSuccess:()=>e.invalidateQueries({queryKey:["servers"]})})}function cE(){const e=Kr();return _r({mutationFn:t=>Je.servers.delete(t),onSuccess:()=>e.invalidateQueries({queryKey:["servers"]})})}function uE(){return _r({mutationFn:e=>Je.servers.test(e)})}function Op(){return Al({queryKey:["collections"],queryFn:()=>Je.collections.list()})}function dE(){const e=Kr();return _r({mutationFn:t=>Je.collections.create(t),onSuccess:()=>e.invalidateQueries({queryKey:["collections"]})})}function fE(){const e=Kr();return _r({mutationFn:({id:t,data:n})=>Je.collections.update(t,n),onSuccess:()=>e.invalidateQueries({queryKey:["collections"]})})}function hE(){const e=Kr();return _r({mutationFn:t=>Je.collections.delete(t),onSuccess:()=>e.invalidateQueries({queryKey:["collections"]})})}function pE(){return _r({mutationFn:e=>Je.collections.validate(e)})}function iw(e){return Al({queryKey:["runs",e],queryFn:()=>Je.runs.list(e),refetchInterval:5e3})}function mE(e){return Al({queryKey:["runs",e],queryFn:()=>Je.runs.get(e),enabled:!!e,refetchInterval:t=>{var i,o;return((o=(i=t.state.data)==null?void 0:i.data)==null?void 0:o.status)==="running"?2e3:!1}})}function ow(){const e=Kr();return _r({mutationFn:t=>Je.runs.trigger(t),onSuccess:()=>e.invalidateQueries({queryKey:["runs"]})})}function gE(){const e=Kr();return _r({mutationFn:t=>Je.runs.delete(t),onSuccess:()=>e.invalidateQueries({queryKey:["runs"]})})}function vE({status:e}){switch(e){case"completed":return d.jsxs(dt,{variant:"success",children:[d.jsx(Il,{className:"mr-1 h-3 w-3"}),"Completed"]});case"failed":return d.jsxs(dt,{variant:"destructive",children:[d.jsx(ha,{className:"mr-1 h-3 w-3"}),"Failed"]});case"running":return d.jsxs(dt,{variant:"warning",children:[d.jsx(Np,{className:"mr-1 h-3 w-3"}),"Running"]});default:return d.jsx(dt,{variant:"secondary",children:e})}}function yE(){var i,o,l,u,c;const e=Ml(),t=Op(),n=iw(5);return d.jsxs("div",{className:"space-y-6",children:[d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Dashboard"}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[d.jsxs(Ye,{children:[d.jsxs(xt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(wt,{className:"text-sm font-medium",children:"Servers"}),d.jsx(H0,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsx(Xe,{children:d.jsx("div",{className:"text-2xl font-bold",children:((i=e.data)==null?void 0:i.total)??0})})]}),d.jsxs(Ye,{children:[d.jsxs(xt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(wt,{className:"text-sm font-medium",children:"Collections"}),d.jsx(U0,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsx(Xe,{children:d.jsx("div",{className:"text-2xl font-bold",children:((o=t.data)==null?void 0:o.total)??0})})]}),d.jsxs(Ye,{children:[d.jsxs(xt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(wt,{className:"text-sm font-medium",children:"Test Runs"}),d.jsx(Wr,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsx(Xe,{children:d.jsx("div",{className:"text-2xl font-bold",children:((l=n.data)==null?void 0:l.total)??0})})]})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{className:"text-lg",children:"Quick Actions"})}),d.jsxs(Xe,{className:"flex flex-wrap gap-2",children:[d.jsx(Me,{size:"sm",onClick:()=>gs.navigate({to:"/servers"}),children:"Add Server"}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>gs.navigate({to:"/collections"}),children:"New Collection"}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>gs.navigate({to:"/inspect"}),children:"Inspect Server"})]})]}),d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{className:"text-lg",children:"Recent Runs"})}),d.jsx(Xe,{children:((u=n.data)==null?void 0:u.data.length)===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No test runs yet"}):d.jsx("div",{className:"space-y-2",children:(c=n.data)==null?void 0:c.data.map(h=>d.jsxs("div",{className:"flex items-center justify-between rounded-md border p-2 cursor-pointer hover:bg-muted/50",onClick:()=>gs.navigate({to:"/runs/$runId",params:{runId:h.id}}),children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium",children:h.collectionName}),d.jsx("p",{className:"text-xs text-muted-foreground",children:h.duration?`${h.duration}ms`:"In progress..."})]}),d.jsx(vE,{status:h.status})]},h.id))})})]})]})]})}const qu=b.forwardRef(({className:e,...t},n)=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{ref:n,className:pt("w-full caption-bottom text-sm",e),...t})}));qu.displayName="Table";const Zu=b.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:pt("[&_tr]:border-b",e),...t}));Zu.displayName="TableHeader";const Gu=b.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:pt("[&_tr:last-child]:border-0",e),...t}));Gu.displayName="TableBody";const no=b.forwardRef(({className:e,...t},n)=>d.jsx("tr",{ref:n,className:pt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));no.displayName="TableRow";const cn=b.forwardRef(({className:e,...t},n)=>d.jsx("th",{ref:n,className:pt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));cn.displayName="TableHead";const un=b.forwardRef(({className:e,...t},n)=>d.jsx("td",{ref:n,className:pt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));un.displayName="TableCell";function nt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function xE(e,t){const n=b.createContext(t),i=l=>{const{children:u,...c}=l,h=b.useMemo(()=>c,Object.values(c));return d.jsx(n.Provider,{value:h,children:u})};i.displayName=e+"Provider";function o(l){const u=b.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[i,o]}function ga(e,t=[]){let n=[];function i(l,u){const c=b.createContext(u),h=n.length;n=[...n,u];const m=y=>{var N;const{scope:x,children:w,..._}=y,S=((N=x==null?void 0:x[e])==null?void 0:N[h])||c,C=b.useMemo(()=>_,Object.values(_));return d.jsx(S.Provider,{value:C,children:w})};m.displayName=l+"Provider";function g(y,x){var S;const w=((S=x==null?void 0:x[e])==null?void 0:S[h])||c,_=b.useContext(w);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${l}\``)}return[m,g]}const o=()=>{const l=n.map(u=>b.createContext(u));return function(c){const h=(c==null?void 0:c[e])||l;return b.useMemo(()=>({[`__scope${e}`]:{...c,[e]:h}}),[c,h])}};return o.scopeName=e,[i,wE(o,...t)]}function wE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=i.reduce((c,{useScope:h,scopeName:m})=>{const y=h(l)[`__scope${m}`];return{...c,...y}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var dn=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},SE=fp[" useId ".trim().toString()]||(()=>{}),bE=0;function fi(e){const[t,n]=b.useState(SE());return dn(()=>{n(i=>i??String(bE++))},[e]),t?`radix-${t}`:""}var CE=fp[" useInsertionEffect ".trim().toString()]||dn;function yl({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[o,l,u]=kE({defaultProp:t,onChange:n}),c=e!==void 0,h=c?e:o;{const g=b.useRef(e!==void 0);b.useEffect(()=>{const y=g.current;y!==c&&console.warn(`${i} is changing from ${y?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=c},[c,i])}const m=b.useCallback(g=>{var y;if(c){const x=_E(g)?g(e):g;x!==e&&((y=u.current)==null||y.call(u,x))}else l(g)},[c,e,l,u]);return[h,m]}function kE({defaultProp:e,onChange:t}){const[n,i]=b.useState(e),o=b.useRef(n),l=b.useRef(t);return CE(()=>{l.current=t},[t]),b.useEffect(()=>{var u;o.current!==n&&((u=l.current)==null||u.call(l,n),o.current=n)},[n,o]),[n,i,l]}function _E(e){return typeof e=="function"}function xl(e){const t=jE(e),n=b.forwardRef((i,o)=>{const{children:l,...u}=i,c=b.Children.toArray(l),h=c.find(RE);if(h){const m=h.props.children,g=c.map(y=>y===h?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:y);return d.jsx(t,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,g):null})}return d.jsx(t,{...u,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function jE(e){const t=b.forwardRef((n,i)=>{const{children:o,...l}=n;if(b.isValidElement(o)){const u=PE(o),c=NE(l,o.props);return o.type!==b.Fragment&&(c.ref=i?Tp(i,u):u),b.cloneElement(o,c)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EE=Symbol("radix.slottable");function RE(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EE}function NE(e,t){const n={...t};for(const i in t){const o=e[i],l=t[i];/^on[A-Z]/.test(i)?o&&l?n[i]=(...c)=>{const h=l(...c);return o(...c),h}:o&&(n[i]=o):i==="style"?n[i]={...o,...l}:i==="className"&&(n[i]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function PE(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var TE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ct=TE.reduce((e,t)=>{const n=xl(`Primitive.${t}`),i=b.forwardRef((o,l)=>{const{asChild:u,...c}=o,h=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...c,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function OE(e,t){e&&fa.flushSync(()=>e.dispatchEvent(t))}function pi(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}function AE(e,t=globalThis==null?void 0:globalThis.document){const n=pi(e);b.useEffect(()=>{const i=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var IE="DismissableLayer",Kh="dismissableLayer.update",ME="dismissableLayer.pointerDownOutside",LE="dismissableLayer.focusOutside",Ly,aw=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ap=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:c,...h}=e,m=b.useContext(aw),[g,y]=b.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=b.useState({}),_=It(t,O=>y(O)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(C),k=g?S.indexOf(g):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,j=k>=N,P=zE(O=>{const L=O.target,V=[...m.branches].some(M=>M.contains(L));!j||V||(o==null||o(O),u==null||u(O),O.defaultPrevented||c==null||c())},x),T=VE(O=>{const L=O.target;[...m.branches].some(M=>M.contains(L))||(l==null||l(O),u==null||u(O),O.defaultPrevented||c==null||c())},x);return AE(O=>{k===m.layers.size-1&&(i==null||i(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},x),b.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Ly=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),Fy(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Ly)}},[g,x,n,m]),b.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),Fy())},[g,m]),b.useEffect(()=>{const O=()=>w({});return document.addEventListener(Kh,O),()=>document.removeEventListener(Kh,O)},[]),d.jsx(ct.div,{...h,ref:_,style:{pointerEvents:R?j?"auto":"none":void 0,...e.style},onFocusCapture:nt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:nt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:nt(e.onPointerDownCapture,P.onPointerDownCapture)})});Ap.displayName=IE;var FE="DismissableLayerBranch",DE=b.forwardRef((e,t)=>{const n=b.useContext(aw),i=b.useRef(null),o=It(t,i);return b.useEffect(()=>{const l=i.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),d.jsx(ct.div,{...e,ref:o})});DE.displayName=FE;function zE(e,t=globalThis==null?void 0:globalThis.document){const n=pi(e),i=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const l=c=>{if(c.target&&!i.current){let h=function(){lw(ME,n,m,{discrete:!0})};const m={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);i.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",l),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function VE(e,t=globalThis==null?void 0:globalThis.document){const n=pi(e),i=b.useRef(!1);return b.useEffect(()=>{const o=l=>{l.target&&!i.current&&lw(LE,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Fy(){const e=new CustomEvent(Kh);document.dispatchEvent(e)}function lw(e,t,n,{discrete:i}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),i?OE(o,l):o.dispatchEvent(l)}var dh="focusScope.autoFocusOnMount",fh="focusScope.autoFocusOnUnmount",Dy={bubbles:!1,cancelable:!0},$E="FocusScope",Ip=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[c,h]=b.useState(null),m=pi(o),g=pi(l),y=b.useRef(null),x=It(t,S=>h(S)),w=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(i){let S=function(R){if(w.paused||!c)return;const j=R.target;c.contains(j)?y.current=j:qs(y.current,{select:!0})},C=function(R){if(w.paused||!c)return;const j=R.relatedTarget;j!==null&&(c.contains(j)||qs(y.current,{select:!0}))},N=function(R){if(document.activeElement===document.body)for(const P of R)P.removedNodes.length>0&&qs(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const k=new MutationObserver(N);return c&&k.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),k.disconnect()}}},[i,c,w.paused]),b.useEffect(()=>{if(c){Vy.add(w);const S=document.activeElement;if(!c.contains(S)){const N=new CustomEvent(dh,Dy);c.addEventListener(dh,m),c.dispatchEvent(N),N.defaultPrevented||(BE(QE(cw(c)),{select:!0}),document.activeElement===S&&qs(c))}return()=>{c.removeEventListener(dh,m),setTimeout(()=>{const N=new CustomEvent(fh,Dy);c.addEventListener(fh,g),c.dispatchEvent(N),N.defaultPrevented||qs(S??document.body,{select:!0}),c.removeEventListener(fh,g),Vy.remove(w)},0)}}},[c,m,g,w]);const _=b.useCallback(S=>{if(!n&&!i||w.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(C&&N){const k=S.currentTarget,[R,j]=UE(k);R&&j?!S.shiftKey&&N===j?(S.preventDefault(),n&&qs(R,{select:!0})):S.shiftKey&&N===R&&(S.preventDefault(),n&&qs(j,{select:!0})):N===k&&S.preventDefault()}},[n,i,w.paused]);return d.jsx(ct.div,{tabIndex:-1,...u,ref:x,onKeyDown:_})});Ip.displayName=$E;function BE(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(qs(i,{select:t}),document.activeElement!==n)return}function UE(e){const t=cw(e),n=zy(t,e),i=zy(t.reverse(),e);return[n,i]}function cw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zy(e,t){for(const n of e)if(!WE(n,{upTo:t}))return n}function WE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function HE(e){return e instanceof HTMLInputElement&&"select"in e}function qs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&HE(e)&&t&&e.select()}}var Vy=KE();function KE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$y(e,t),e.unshift(t)},remove(t){var n;e=$y(e,t),(n=e[0])==null||n.resume()}}}function $y(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function QE(e){return e.filter(t=>t.tagName!=="A")}var qE="Portal",Mp=b.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[o,l]=b.useState(!1);dn(()=>l(!0),[]);const u=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?w_.createPortal(d.jsx(ct.div,{...i,ref:t}),u):null});Mp.displayName=qE;function ZE(e,t){return b.useReducer((n,i)=>t[n][i]??n,e)}var Ll=e=>{const{present:t,children:n}=e,i=GE(t),o=typeof n=="function"?n({present:i.isPresent}):b.Children.only(n),l=It(i.ref,YE(o));return typeof n=="function"||i.isPresent?b.cloneElement(o,{ref:l}):null};Ll.displayName="Presence";function GE(e){const[t,n]=b.useState(),i=b.useRef(null),o=b.useRef(e),l=b.useRef("none"),u=e?"mounted":"unmounted",[c,h]=ZE(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const m=Xc(i.current);l.current=c==="mounted"?m:"none"},[c]),dn(()=>{const m=i.current,g=o.current;if(g!==e){const x=l.current,w=Xc(m);e?h("MOUNT"):w==="none"||(m==null?void 0:m.display)==="none"?h("UNMOUNT"):h(g&&x!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),dn(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,y=w=>{const S=Xc(i.current).includes(CSS.escape(w.animationName));if(w.target===t&&S&&(h("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=w=>{w.target===t&&(l.current=Xc(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(m=>{i.current=m?getComputedStyle(m):null,n(m)},[])}}function Xc(e){return(e==null?void 0:e.animationName)||"none"}function YE(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=0;function uw(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??By()),document.body.insertAdjacentElement("beforeend",e[1]??By()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function By(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zr=function(){return zr=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},zr.apply(this,arguments)};function dw(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function XE(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,l;i<o;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}var uu="right-scroll-bar-position",du="width-before-scroll-bar",JE="with-scroll-bars-hidden",eR="--removed-body-scroll-bar-size";function ph(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tR(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var o=n.value;o!==i&&(n.value=i,n.callback(i,o))}}}})[0];return n.callback=t,n.facade}var nR=typeof window<"u"?b.useLayoutEffect:b.useEffect,Uy=new WeakMap;function rR(e,t){var n=tR(null,function(i){return e.forEach(function(o){return ph(o,i)})});return nR(function(){var i=Uy.get(n);if(i){var o=new Set(i),l=new Set(e),u=n.current;o.forEach(function(c){l.has(c)||ph(c,null)}),l.forEach(function(c){o.has(c)||ph(c,u)})}Uy.set(n,e)},[e]),n}function sR(e){return e}function iR(e,t){t===void 0&&(t=sR);var n=[],i=!1,o={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var u=t(l,i);return n.push(u),function(){n=n.filter(function(c){return c!==u})}},assignSyncMedium:function(l){for(i=!0;n.length;){var u=n;n=[],u.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){i=!0;var u=[];if(n.length){var c=n;n=[],c.forEach(l),u=n}var h=function(){var g=u;u=[],g.forEach(l)},m=function(){return Promise.resolve().then(h)};m(),n={push:function(g){u.push(g),m()},filter:function(g){return u=u.filter(g),n}}}};return o}function oR(e){e===void 0&&(e={});var t=iR(null);return t.options=zr({async:!0,ssr:!1},e),t}var fw=function(e){var t=e.sideCar,n=dw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return b.createElement(i,zr({},n))};fw.isSideCarExport=!0;function aR(e,t){return e.useMedium(t),fw}var hw=oR(),mh=function(){},Yu=b.forwardRef(function(e,t){var n=b.useRef(null),i=b.useState({onScrollCapture:mh,onWheelCapture:mh,onTouchMoveCapture:mh}),o=i[0],l=i[1],u=e.forwardProps,c=e.children,h=e.className,m=e.removeScrollBar,g=e.enabled,y=e.shards,x=e.sideCar,w=e.noRelative,_=e.noIsolation,S=e.inert,C=e.allowPinchZoom,N=e.as,k=N===void 0?"div":N,R=e.gapMode,j=dw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=x,T=rR([n,t]),O=zr(zr({},j),o);return b.createElement(b.Fragment,null,g&&b.createElement(P,{sideCar:hw,removeScrollBar:m,shards:y,noRelative:w,noIsolation:_,inert:S,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:R}),u?b.cloneElement(b.Children.only(c),zr(zr({},O),{ref:T})):b.createElement(k,zr({},O,{className:h,ref:T}),c))});Yu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yu.classNames={fullWidth:du,zeroRight:uu};var lR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lR();return t&&e.setAttribute("nonce",t),e}function uR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cR())&&(uR(t,n),dR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hR=function(){var e=fR();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pw=function(){var e=hR(),t=function(n){var i=n.styles,o=n.dynamic;return e(i,o),null};return t},pR={left:0,top:0,right:0,gap:0},gh=function(e){return parseInt(e||"",10)||0},mR=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[gh(n),gh(i),gh(o)]},gR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pR;var t=mR(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},vR=pw(),Uo="data-scroll-locked",yR=function(e,t,n,i){var o=e.left,l=e.top,u=e.right,c=e.gap;return n===void 0&&(n="margin"),`
267
267
  .`.concat(JE,` {
268
268
  overflow: hidden `).concat(i,`;
269
269
  padding-right: `).concat(c,"px ").concat(i,`;
@@ -358,4 +358,4 @@ tests:
358
358
  expect:
359
359
  - exists: $.content
360
360
  `;function S2(){var P,T;const[e,t]=b.useState(!1),[n,i]=b.useState(null),[o,l]=b.useState(""),[u,c]=b.useState(zx),[h,m]=b.useState(""),[g,y]=b.useState(null),x=Op(),w=dE(),_=fE(),S=hE(),C=pE(),N=ow();async function k(){await w.mutateAsync({name:o,yaml:u}),t(!1),l(""),c(zx)}async function R(O){const L=await C.mutateAsync(O);y(L.data)}async function j(O){const L=await N.mutateAsync({collectionId:O});gs.navigate({to:"/runs/$runId",params:{runId:L.data.id}})}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Collections"}),d.jsxs(ju,{open:e,onOpenChange:t,children:[d.jsx(Vp,{asChild:!0,children:d.jsxs(Me,{children:[d.jsx(W0,{className:"mr-2 h-4 w-4"}),"New Collection"]})}),d.jsxs(wl,{className:"max-w-2xl",children:[d.jsx(Eu,{children:d.jsx(Sl,{children:"Create Collection"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium",children:"Name"}),d.jsx(Bt,{value:o,onChange:O=>l(O.target.value),placeholder:"Collection name"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium",children:"YAML"}),d.jsx(Dx,{value:u,onChange:c})]}),d.jsx(Me,{onClick:k,disabled:!o||w.isPending,className:"w-full",children:w.isPending?"Creating...":"Create Collection"})]})]})]})]}),d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:"Saved Collections"})}),d.jsx(Xe,{children:((P=x.data)==null?void 0:P.data.length)===0?d.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No collections yet"}):d.jsxs(qu,{children:[d.jsx(Zu,{children:d.jsxs(no,{children:[d.jsx(cn,{children:"Name"}),d.jsx(cn,{children:"Description"}),d.jsx(cn,{children:"Updated"}),d.jsx(cn,{className:"text-right",children:"Actions"})]})}),d.jsx(Gu,{children:(T=x.data)==null?void 0:T.data.map(O=>d.jsxs(no,{children:[d.jsx(un,{className:"font-medium",children:O.name}),d.jsx(un,{className:"text-sm text-muted-foreground",children:O.description??"-"}),d.jsx(un,{className:"text-sm text-muted-foreground",children:new Date(O.updatedAt).toLocaleDateString()}),d.jsxs(un,{className:"text-right space-x-2",children:[d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>{i(O.id),m(O.yaml)},children:d.jsx(ij,{className:"h-4 w-4"})}),d.jsx(Me,{size:"sm",variant:"secondary",onClick:()=>j(O.id),children:d.jsx(Wr,{className:"h-4 w-4"})}),d.jsx(Me,{size:"sm",variant:"ghost",onClick:()=>S.mutate(O.id),children:d.jsx(pa,{className:"h-4 w-4 text-destructive"})})]})]},O.id))})]})})]}),d.jsx(ju,{open:!!n,onOpenChange:O=>{O||i(null)},children:d.jsxs(wl,{className:"max-w-2xl",children:[d.jsx(Eu,{children:d.jsx(Sl,{children:"Edit Collection"})}),d.jsx(Dx,{value:h,onChange:m,onValidate:()=>n&&R(n),validating:C.isPending,onSave:async()=>{n&&(await _.mutateAsync({id:n,data:{yaml:h}}),i(null))},saving:_.isPending,onRun:()=>n&&j(n)}),g&&d.jsx("div",{className:"flex items-center gap-2 mt-2",children:g.valid?d.jsxs(dt,{variant:"success",children:[d.jsx(Il,{className:"mr-1 h-3 w-3"}),"Valid"]}):d.jsxs(dt,{variant:"destructive",children:[d.jsx(ha,{className:"mr-1 h-3 w-3"}),"Invalid"]})})]})})]})}function b2({status:e}){switch(e){case"completed":return d.jsxs(dt,{variant:"success",children:[d.jsx(Il,{className:"mr-1 h-3 w-3"}),"Completed"]});case"failed":return d.jsxs(dt,{variant:"destructive",children:[d.jsx(ha,{className:"mr-1 h-3 w-3"}),"Failed"]});case"running":return d.jsxs(dt,{variant:"warning",children:[d.jsx(Cu,{className:"mr-1 h-3 w-3 animate-spin"}),"Running"]});case"cancelled":return d.jsxs(dt,{variant:"secondary",children:[d.jsx(Np,{className:"mr-1 h-3 w-3"}),"Cancelled"]});default:return d.jsx(dt,{variant:"secondary",children:e})}}function C2(){var m,g,y;const[e,t]=b.useState(!1),[n,i]=b.useState(""),o=iw(),l=Op(),u=ow(),c=gE();async function h(){if(!n)return;const x=await u.mutateAsync({collectionId:n});t(!1),gs.navigate({to:"/runs/$runId",params:{runId:x.data.id}})}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Test Runs"}),d.jsxs(ju,{open:e,onOpenChange:t,children:[d.jsx(Vp,{asChild:!0,children:d.jsxs(Me,{children:[d.jsx(Wr,{className:"mr-2 h-4 w-4"}),"Run Collection"]})}),d.jsxs(wl,{children:[d.jsx(Eu,{children:d.jsx(Sl,{children:"Run Collection"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium",children:"Collection"}),d.jsxs(Pn,{value:n,onValueChange:i,children:[d.jsx(yn,{children:d.jsx(Tn,{placeholder:"Select a collection"})}),d.jsx(xn,{children:(m=l.data)==null?void 0:m.data.map(x=>d.jsx(ut,{value:x.id,children:x.name},x.id))})]})]}),d.jsx(Me,{onClick:h,disabled:!n||u.isPending,className:"w-full",children:u.isPending?"Starting...":"Start Run"})]})]})]})]}),d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:"Run History"})}),d.jsx(Xe,{children:((g=o.data)==null?void 0:g.data.length)===0?d.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No runs yet"}):d.jsxs(qu,{children:[d.jsx(Zu,{children:d.jsxs(no,{children:[d.jsx(cn,{children:"Collection"}),d.jsx(cn,{children:"Status"}),d.jsx(cn,{children:"Tests"}),d.jsx(cn,{children:"Duration"}),d.jsx(cn,{children:"Started"}),d.jsx(cn,{className:"text-right",children:"Actions"})]})}),d.jsx(Gu,{children:(y=o.data)==null?void 0:y.data.map(x=>d.jsxs(no,{className:"cursor-pointer",onClick:()=>gs.navigate({to:"/runs/$runId",params:{runId:x.id}}),children:[d.jsx(un,{className:"font-medium",children:x.collectionName}),d.jsx(un,{children:d.jsx(b2,{status:x.status})}),d.jsx(un,{children:x.summary?d.jsxs("span",{className:"text-sm",children:[d.jsx("span",{className:"text-green-600",children:x.summary.passed})," / ",d.jsx("span",{children:x.summary.total}),x.summary.failed>0&&d.jsxs("span",{className:"text-red-600",children:[" (",x.summary.failed," failed)"]})]}):"-"}),d.jsx(un,{children:x.duration?`${x.duration}ms`:"-"}),d.jsx(un,{className:"text-sm text-muted-foreground",children:new Date(x.startedAt).toLocaleString()}),d.jsx(un,{className:"text-right",onClick:w=>w.stopPropagation(),children:d.jsx(Me,{size:"sm",variant:"ghost",onClick:()=>c.mutate(x.id),children:d.jsx(pa,{className:"h-4 w-4 text-destructive"})})})]},x.id))})]})})]})]})}function k2({status:e}){switch(e){case"passed":return d.jsx(Il,{className:"h-4 w-4 text-green-600"});case"failed":return d.jsx(ha,{className:"h-4 w-4 text-red-600"});case"error":return d.jsx(Np,{className:"h-4 w-4 text-red-600"});case"skipped":return d.jsx(Cu,{className:"h-4 w-4 text-yellow-600"});default:return null}}function _2({result:e}){const[t,n]=b.useState(!1);return d.jsxs("div",{className:"rounded-md border p-3 cursor-pointer hover:bg-muted/30 transition-colors",onClick:()=>n(!t),children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(k2,{status:e.status}),d.jsx("span",{className:"text-sm font-medium",children:e.testName})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.duration,"ms"]}),d.jsx(dt,{variant:e.status==="passed"?"success":e.status==="failed"?"destructive":"secondary",children:e.status})]})]}),t&&d.jsxs("div",{className:"mt-3 space-y-2 text-sm",children:[e.error&&d.jsx("div",{className:"rounded bg-red-50 p-2 text-red-700 font-mono text-xs",children:e.error}),e.assertions.length>0&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"font-medium text-xs text-muted-foreground",children:"Assertions:"}),e.assertions.map((i,o)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.passed?d.jsx(Il,{className:"h-3 w-3 text-green-600"}):d.jsx(ha,{className:"h-3 w-3 text-red-600"}),d.jsx("span",{children:i.message})]},o))]})]})]})}function j2(){const{runId:e}=Ku({from:"/runs/$runId"}),{data:t,isLoading:n}=mE(e),i=t==null?void 0:t.data;return n?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx(Cu,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):i?d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(Me,{variant:"ghost",size:"sm",onClick:()=>gs.navigate({to:"/runs"}),children:[d.jsx(Qu,{className:"h-4 w-4 mr-1"}),"Back"]}),d.jsx("h2",{className:"text-2xl font-bold",children:i.collectionName}),d.jsx(dt,{variant:i.status==="completed"?"success":i.status==="failed"?"destructive":"warning",children:i.status})]}),i.summary&&d.jsxs("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-5",children:[d.jsx(Ye,{children:d.jsxs(Xe,{className:"pt-4 text-center",children:[d.jsx("p",{className:"text-2xl font-bold",children:i.summary.total}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Total"})]})}),d.jsx(Ye,{children:d.jsxs(Xe,{className:"pt-4 text-center",children:[d.jsx("p",{className:"text-2xl font-bold text-green-600",children:i.summary.passed}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Passed"})]})}),d.jsx(Ye,{children:d.jsxs(Xe,{className:"pt-4 text-center",children:[d.jsx("p",{className:"text-2xl font-bold text-red-600",children:i.summary.failed}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Failed"})]})}),d.jsx(Ye,{children:d.jsxs(Xe,{className:"pt-4 text-center",children:[d.jsx("p",{className:"text-2xl font-bold text-yellow-600",children:i.summary.skipped}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Skipped"})]})}),d.jsx(Ye,{children:d.jsxs(Xe,{className:"pt-4 text-center",children:[d.jsxs("p",{className:"text-2xl font-bold",children:[i.summary.duration,"ms"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Duration"})]})})]}),d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:"Test Results"})}),d.jsx(Xe,{className:"space-y-2",children:i.results&&i.results.length>0?i.results.map((o,l)=>d.jsx(_2,{result:o},l)):i.status==="running"?d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-4 justify-center",children:[d.jsx(Cu,{className:"h-4 w-4 animate-spin"}),"Running tests..."]}):d.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No results"})})]})]}):d.jsx("p",{className:"text-muted-foreground",children:"Run not found"})}var Ch="rovingFocusGroup.onEntryFocus",E2={bubbles:!1,cancelable:!0},zl="RovingFocusGroup",[cp,US,R2]=Zw(zl),[N2,WS]=ga(zl,[R2]),[P2,T2]=N2(zl),HS=b.forwardRef((e,t)=>d.jsx(cp.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(cp.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(O2,{...e,ref:t})})}));HS.displayName=zl;var O2=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:o=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...y}=e,x=b.useRef(null),w=It(t,x),_=Qp(l),[S,C]=yl({prop:u,defaultProp:c??null,onChange:h,caller:zl}),[N,k]=b.useState(!1),R=pi(m),j=US(n),P=b.useRef(!1),[T,O]=b.useState(0);return b.useEffect(()=>{const L=x.current;if(L)return L.addEventListener(Ch,R),()=>L.removeEventListener(Ch,R)},[R]),d.jsx(P2,{scope:n,orientation:i,dir:_,loop:o,currentTabStopId:S,onItemFocus:b.useCallback(L=>C(L),[C]),onItemShiftTab:b.useCallback(()=>k(!0),[]),onFocusableItemAdd:b.useCallback(()=>O(L=>L+1),[]),onFocusableItemRemove:b.useCallback(()=>O(L=>L-1),[]),children:d.jsx(ct.div,{tabIndex:N||T===0?-1:0,"data-orientation":i,...y,ref:w,style:{outline:"none",...e.style},onMouseDown:nt(e.onMouseDown,()=>{P.current=!0}),onFocus:nt(e.onFocus,L=>{const V=!P.current;if(L.target===L.currentTarget&&V&&!N){const M=new CustomEvent(Ch,E2);if(L.currentTarget.dispatchEvent(M),!M.defaultPrevented){const Z=j().filter(X=>X.focusable),W=Z.find(X=>X.active),ee=Z.find(X=>X.id===S),oe=[W,ee,...Z].filter(Boolean).map(X=>X.ref.current);qS(oe,g)}}P.current=!1}),onBlur:nt(e.onBlur,()=>k(!1))})})}),KS="RovingFocusGroupItem",QS=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:o=!1,tabStopId:l,children:u,...c}=e,h=fi(),m=l||h,g=T2(KS,n),y=g.currentTabStopId===m,x=US(n),{onFocusableItemAdd:w,onFocusableItemRemove:_,currentTabStopId:S}=g;return b.useEffect(()=>{if(i)return w(),()=>_()},[i,w,_]),d.jsx(cp.ItemSlot,{scope:n,id:m,focusable:i,active:o,children:d.jsx(ct.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...c,ref:t,onMouseDown:nt(e.onMouseDown,C=>{i?g.onItemFocus(m):C.preventDefault()}),onFocus:nt(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:nt(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const N=M2(C,g.orientation,g.dir);if(N!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=x().filter(j=>j.focusable).map(j=>j.ref.current);if(N==="last")R.reverse();else if(N==="prev"||N==="next"){N==="prev"&&R.reverse();const j=R.indexOf(C.currentTarget);R=g.loop?L2(R,j+1):R.slice(j+1)}setTimeout(()=>qS(R))}}),children:typeof u=="function"?u({isCurrentTabStop:y,hasTabStop:S!=null}):u})})});QS.displayName=KS;var A2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function I2(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function M2(e,t,n){const i=I2(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return A2[i]}function qS(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}function L2(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var F2=HS,D2=QS,ad="Tabs",[z2]=ga(ad,[WS]),ZS=WS(),[V2,rm]=z2(ad),GS=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,onValueChange:o,defaultValue:l,orientation:u="horizontal",dir:c,activationMode:h="automatic",...m}=e,g=Qp(c),[y,x]=yl({prop:i,onChange:o,defaultProp:l??"",caller:ad});return d.jsx(V2,{scope:n,baseId:fi(),value:y,onValueChange:x,orientation:u,dir:g,activationMode:h,children:d.jsx(ct.div,{dir:g,"data-orientation":u,...m,ref:t})})});GS.displayName=ad;var YS="TabsList",XS=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:i=!0,...o}=e,l=rm(YS,n),u=ZS(n);return d.jsx(F2,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:i,children:d.jsx(ct.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:t})})});XS.displayName=YS;var JS="TabsTrigger",eb=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,disabled:o=!1,...l}=e,u=rm(JS,n),c=ZS(n),h=rb(u.baseId,i),m=sb(u.baseId,i),g=i===u.value;return d.jsx(D2,{asChild:!0,...c,focusable:!o,active:g,children:d.jsx(ct.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:h,...l,ref:t,onMouseDown:nt(e.onMouseDown,y=>{!o&&y.button===0&&y.ctrlKey===!1?u.onValueChange(i):y.preventDefault()}),onKeyDown:nt(e.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&u.onValueChange(i)}),onFocus:nt(e.onFocus,()=>{const y=u.activationMode!=="manual";!g&&!o&&y&&u.onValueChange(i)})})})});eb.displayName=JS;var tb="TabsContent",nb=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,forceMount:o,children:l,...u}=e,c=rm(tb,n),h=rb(c.baseId,i),m=sb(c.baseId,i),g=i===c.value,y=b.useRef(g);return b.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),d.jsx(Ll,{present:o||g,children:({present:x})=>d.jsx(ct.div,{"data-state":g?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":h,hidden:!x,id:m,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:x&&l})})});nb.displayName=tb;function rb(e,t){return`${e}-trigger-${t}`}function sb(e,t){return`${e}-content-${t}`}var $2=GS,B2=XS,U2=eb,W2=nb;const up=$2,Vu=b.forwardRef(({className:e,...t},n)=>d.jsx(B2,{ref:n,className:pt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Vu.displayName="TabsList";const ls=b.forwardRef(({className:e,...t},n)=>d.jsx(U2,{ref:n,className:pt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ls.displayName="TabsTrigger";const cs=b.forwardRef(({className:e,...t},n)=>d.jsx(W2,{ref:n,className:pt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));cs.displayName="TabsContent";const jl=b.forwardRef(({className:e,...t},n)=>d.jsx("textarea",{className:pt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));jl.displayName="Textarea";const ib=b.forwardRef(({className:e,...t},n)=>d.jsx("input",{type:"checkbox",className:pt("h-4 w-4 shrink-0 rounded border border-input ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));ib.displayName="Checkbox";const El=b.forwardRef(({className:e,...t},n)=>d.jsx("label",{className:pt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),ref:n,...t}));El.displayName="Label";function H2(e,t){return e.default!==void 0?e.default:e.type==="boolean"?!1:e.type==="number"||e.type==="integer"?t?0:"":(e.type==="object"||e.type==="array","")}function K2(e,t){const n={};for(const[i,o]of Object.entries(e))n[i]=H2(o,t.includes(i));return n}function Vx(e,t){if(t.type==="number"||t.type==="integer"){const i=String(e);if(i==="")return;const o=Number(i);return isNaN(o)?void 0:o}if(t.type==="boolean")return!!e;if(t.type==="object"||t.type==="array"){const i=String(e).trim();if(!i)return;try{return JSON.parse(i)}catch{return}}const n=String(e);return n===""?void 0:n}function Q2(e){return!!(e.maxLength&&e.maxLength>200||e.format==="textarea")}function q2(e){return e.format==="uri"||e.format==="url"?"url":e.format==="email"?"email":e.format==="date"?"date":e.format==="date-time"?"datetime-local":"text"}function Z2({name:e,prop:t,required:n,value:i,onChange:o}){const l=`field-${e}`,u=d.jsxs(El,{htmlFor:l,children:[e,n&&d.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),c=t.description?d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.description}):null;return t.enum&&t.enum.length>0?d.jsxs("div",{className:"space-y-1.5",children:[u,d.jsxs(Pn,{value:String(i??""),onValueChange:h=>o(e,h),children:[d.jsx(yn,{id:l,children:d.jsx(Tn,{placeholder:`Select ${e}`})}),d.jsx(xn,{children:t.enum.map(h=>d.jsx(ut,{value:h,children:h},h))})]}),c]}):t.type==="boolean"?d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ib,{id:l,checked:!!i,onChange:h=>o(e,h.target.checked)}),d.jsxs(El,{htmlFor:l,children:[e,n&&d.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]})]}),c]}):t.type==="number"||t.type==="integer"?d.jsxs("div",{className:"space-y-1.5",children:[u,d.jsx(Bt,{id:l,type:"number",value:i===void 0?"":String(i),onChange:h=>o(e,h.target.value),min:t.minimum,max:t.maximum,step:t.type==="integer"?1:void 0,required:n}),c]}):t.type==="object"||t.type==="array"||t.type&&!["string","number","integer","boolean"].includes(t.type)?d.jsxs("div",{className:"space-y-1.5",children:[u,d.jsx(jl,{id:l,value:String(i??""),onChange:h=>o(e,h.target.value),className:"font-mono text-xs",rows:3,placeholder:t.type==="array"?'["item1", "item2"]':'{"key": "value"}',required:n}),c]}):Q2(t)?d.jsxs("div",{className:"space-y-1.5",children:[u,d.jsx(jl,{id:l,value:String(i??""),onChange:h=>o(e,h.target.value),rows:3,minLength:t.minLength,maxLength:t.maxLength,required:n}),c]}):d.jsxs("div",{className:"space-y-1.5",children:[u,d.jsx(Bt,{id:l,type:q2(t),value:String(i??""),onChange:h=>o(e,h.target.value),minLength:t.minLength,maxLength:t.maxLength,required:n}),c]})}function G2({schema:e,onSubmit:t,loading:n}){const i=e.properties??{},o=e.required??[],l=Object.keys(i),[u,c]=b.useState(()=>K2(i,o)),[h,m]=b.useState(!1),[g,y]=b.useState("{}"),x=b.useCallback((C,N)=>{c(k=>({...k,[C]:N}))},[]);function w(C){if(C.preventDefault(),h){try{t(JSON.parse(g))}catch{}return}const N={};for(const[k,R]of Object.entries(i)){const j=Vx(u[k],R);j!==void 0&&(N[k]=j)}t(N)}function _(){const C={};for(const[N,k]of Object.entries(i)){const R=Vx(u[N],k);R!==void 0&&(C[N]=R)}y(JSON.stringify(C,null,2)),m(!0)}function S(){try{const C=JSON.parse(g);typeof C=="object"&&C!==null&&c(N=>({...N,...C}))}catch{}m(!1)}return l.length===0?d.jsxs("form",{onSubmit:w,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(El,{children:"Input (JSON)"}),d.jsx(jl,{value:g,onChange:C=>y(C.target.value),className:"font-mono text-xs",rows:4})]}),d.jsxs(Me,{type:"submit",disabled:n,children:[n?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Wr,{className:"mr-2 h-4 w-4"}),"Call Tool"]})]}):d.jsxs("form",{onSubmit:w,className:"space-y-4",children:[h?d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(El,{children:"Input (JSON)"}),d.jsx(jl,{value:g,onChange:C=>y(C.target.value),className:"font-mono text-xs",rows:8})]}):d.jsx("div",{className:"space-y-3",children:l.map(C=>d.jsx(Z2,{name:C,prop:i[C],required:o.includes(C),value:u[C],onChange:x},C))}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(Me,{type:"submit",disabled:n,children:[n?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Wr,{className:"mr-2 h-4 w-4"}),"Call Tool"]}),d.jsx("button",{type:"button",onClick:h?S:_,className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:h?d.jsxs(d.Fragment,{children:[d.jsx(rj,{className:"h-3.5 w-3.5"}),"Form view"]}):d.jsxs(d.Fragment,{children:[d.jsx(J_,{className:"h-3.5 w-3.5"}),"Raw JSON"]})})]})]})}function sm({data:e}){return d.jsx("pre",{className:"rounded-md border bg-muted/50 p-4 text-xs font-mono overflow-auto max-h-96",children:JSON.stringify(e,null,2)})}function Y2({sessionId:e,tools:t}){const[n,i]=b.useState(""),[o,l]=b.useState(null),[u,c]=b.useState(null),[h,m]=b.useState(!1),g=t.find(w=>w.name===n);async function y(w){if(n){m(!0),c(null),l(null);try{const _=await Je.inspect.call(e,n,w);l(_.data)}catch(_){c(_ instanceof Error?_.message:"Call failed")}m(!1)}}const x=(g==null?void 0:g.inputSchema)??{type:"object",properties:{}};return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium",children:"Tool"}),d.jsxs(Pn,{value:n,onValueChange:w=>{i(w),l(null),c(null)},children:[d.jsx(yn,{children:d.jsx(Tn,{placeholder:"Select a tool"})}),d.jsx(xn,{children:t.map(w=>d.jsx(ut,{value:w.name,children:w.name},w.name))})]}),(g==null?void 0:g.description)&&d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:g.description})]}),g&&d.jsx(G2,{schema:x,onSubmit:y,loading:h},g.name),u!=null&&d.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:u}),o!=null&&d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium",children:"Result"}),d.jsx(sm,{data:o})]})]})}function X2({entries:e}){const[t,n]=b.useState(null),[i,o]=b.useState("all"),[l,u]=b.useState(""),[c,h]=b.useState(!0),[m,g]=b.useState(0),y=b.useRef(null),x=m?e.filter(_=>_.timestamp>m):e;b.useEffect(()=>{c&&y.current&&(y.current.scrollTop=y.current.scrollHeight)},[x,c]);const w=x.filter(_=>!(i!=="all"&&_.direction!==i||l&&!(_.method??"").toLowerCase().includes(l.toLowerCase())));return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsxs(Pn,{value:i,onValueChange:_=>o(_),children:[d.jsx(yn,{className:"w-[130px]",children:d.jsx(Tn,{})}),d.jsxs(xn,{children:[d.jsx(ut,{value:"all",children:"All"}),d.jsx(ut,{value:"outgoing",children:"Outgoing"}),d.jsx(ut,{value:"incoming",children:"Incoming"})]})]}),d.jsx(Bt,{className:"w-[200px]",placeholder:"Filter by method...",value:l,onChange:_=>u(_.target.value)}),d.jsx("div",{className:"flex-1"}),d.jsx(Me,{size:"sm",variant:c?"default":"outline",onClick:()=>h(!c),title:"Auto-scroll",children:d.jsx(Q_,{className:"h-4 w-4"})}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>g(Date.now()),title:"Clear log",children:d.jsx(pa,{className:"h-4 w-4"})}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[w.length," / ",x.length," messages"]})]}),d.jsx("div",{ref:y,className:"rounded-md border overflow-auto max-h-[600px]",children:d.jsx(ob,{entries:w,expandedId:t,onToggle:_=>n(t===_?null:_)})})]})}function ob({entries:e,expandedId:t,onToggle:n}){return d.jsxs("table",{className:"w-full text-xs",children:[d.jsx("thead",{className:"sticky top-0 bg-muted/80 backdrop-blur",children:d.jsxs("tr",{className:"border-b",children:[d.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Time"}),d.jsx("th",{className:"text-left px-3 py-2 font-medium w-10",children:"Dir"}),d.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Method"}),d.jsx("th",{className:"text-left px-3 py-2 font-medium w-16",children:"ID"}),d.jsx("th",{className:"text-right px-3 py-2 font-medium w-16",children:"RTT"}),d.jsx("th",{className:"text-right px-3 py-2 font-medium w-16",children:"Size"})]})}),d.jsx("tbody",{children:e.length===0?d.jsx("tr",{children:d.jsx("td",{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"No protocol messages yet."})}):e.map(i=>d.jsx("tr",{className:"group",children:d.jsxs("td",{colSpan:6,className:"p-0",children:[d.jsx("button",{onClick:()=>n==null?void 0:n(i.id),className:"w-full text-left hover:bg-muted/50 transition-colors",children:d.jsxs("div",{className:"grid grid-cols-[auto_40px_1fr_64px_64px_64px] items-center px-3 py-1.5",children:[d.jsx("span",{className:"font-mono text-muted-foreground pr-3",children:J2(i.timestamp)}),d.jsx("span",{children:i.direction==="outgoing"?d.jsx(Z_,{className:"h-3 w-3 text-blue-500"}):d.jsx(q_,{className:`h-3 w-3 ${i.isError?"text-red-500":"text-green-500"}`})}),d.jsx("span",{className:"truncate",children:i.method?d.jsx("span",{className:"font-medium",children:i.method}):i.isError?d.jsx(dt,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"error"}):d.jsx("span",{className:"text-muted-foreground",children:"response"})}),d.jsx("span",{className:"text-right font-mono text-muted-foreground",children:i.jsonrpcId!=null?String(i.jsonrpcId):""}),d.jsx("span",{className:"text-right font-mono text-muted-foreground",children:i.roundTripMs!=null?`${i.roundTripMs}ms`:""}),d.jsx("span",{className:"text-right font-mono text-muted-foreground",children:tO(eO(i.message))})]})}),t===i.id&&d.jsx("div",{className:"px-3 pb-3",children:d.jsx(sm,{data:i.message})})]})},i.id))})]})}function J2(e){return new Date(e).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}function eO(e){try{return new Blob([JSON.stringify(e)]).size}catch{return 0}}function tO(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}const $x=20;function nO({entries:e}){const[t,n]=b.useState(null),[i,o]=b.useState(0),l=b.useRef(null),c=(i?e.filter(h=>h.timestamp>i):e).slice(-$x);return b.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[e]),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("p",{className:"text-xs font-medium text-muted-foreground",children:["Protocol Log (last ",$x,")"]}),d.jsx(Me,{size:"sm",variant:"ghost",onClick:()=>o(Date.now()),title:"Clear log",className:"h-6 px-2",children:d.jsx(pa,{className:"h-3 w-3"})})]}),d.jsx("div",{ref:l,className:"rounded-md border overflow-auto max-h-[250px]",children:d.jsx(ob,{entries:c,expandedId:t,onToggle:h=>n(t===h?null:h)})})]})}function ld({url:e,onMessage:t,enabled:n=!0}){const i=b.useRef(null),o=b.useRef(0),l=b.useRef(),[u,c]=b.useState(!1),h=e??`ws://${window.location.host}/ws`,m=b.useCallback(()=>{var w;if(((w=i.current)==null?void 0:w.readyState)===WebSocket.OPEN)return;const x=new WebSocket(h);x.onopen=()=>{c(!0),o.current=0},x.onmessage=_=>{try{const S=JSON.parse(_.data);t==null||t(S)}catch{}},x.onclose=()=>{c(!1);const _=Math.min(1e3*2**o.current,3e4);o.current++,o.current<10&&(l.current=setTimeout(m,_))},x.onerror=()=>{x.close()},i.current=x},[h,t]);b.useEffect(()=>(n&&m(),()=>{var x;clearTimeout(l.current),(x=i.current)==null||x.close()}),[n,m]);const g=b.useCallback(x=>{const w=i.current;(w==null?void 0:w.readyState)===WebSocket.OPEN&&w.send(JSON.stringify({type:"subscribe",channel:x}))},[]),y=b.useCallback(x=>{const w=i.current;(w==null?void 0:w.readyState)===WebSocket.OPEN&&w.send(JSON.stringify({type:"unsubscribe",channel:x}))},[]);return{connected:u,subscribe:g,unsubscribe:y}}const Bx=1e4;function rO(e){const[t,n]=b.useState([]);b.useEffect(()=>{if(!e){n([]);return}Je.inspect.messages(e).then(h=>{n(h.data)}).catch(()=>{})},[e]);const i=b.useCallback(h=>{if(e&&h.type==="event"&&h.event==="protocol-message"&&h.channel===`inspect:${e}`){const m=h.data;n(g=>{const y=[...g,m];return y.length>Bx?y.slice(y.length-Bx):y})}},[e]),{subscribe:o,unsubscribe:l,connected:u}=ld({onMessage:i,enabled:!!e});b.useEffect(()=>(u&&e&&o(`inspect:${e}`),()=>{e&&l(`inspect:${e}`)}),[u,e,o,l]);const c=b.useCallback(()=>n([]),[]);return{entries:t,clear:c}}function sO(){var B;const[e,t]=b.useState("saved"),[n,i]=b.useState(""),[o,l]=b.useState(""),[u,c]=b.useState(""),[h,m]=b.useState("stdio"),[g,y]=b.useState(null),[x,w]=b.useState(!1),[_,S]=b.useState([]),[C,N]=b.useState([]),[k,R]=b.useState(null),[j,P]=b.useState(!1),[T,O]=b.useState(""),[L,V]=b.useState(""),[M,Z]=b.useState(!1),W=Ml(),{entries:ee}=rO(g);async function se(){var U;w(!0),R(null);try{let Q;if(e==="saved"){const fe=(U=W.data)==null?void 0:U.data.find(Ne=>Ne.id===n);if(!fe)throw new Error("Server not found");Q={transport:fe.transport,command:fe.command,args:fe.args,url:fe.url,env:fe.env}}else if(h==="stdio"){const fe=o.split(/\s+/);Q={transport:"stdio",command:fe[0],args:fe.slice(1)}}else Q={transport:h,url:u};const I=await Je.inspect.connect(Q);y(I.data.sessionId);const[Y,je]=await Promise.all([Je.inspect.tools(I.data.sessionId),Je.inspect.resources(I.data.sessionId).catch(()=>({data:[]}))]);S(Y.data),N(je.data)}catch(Q){R(Q instanceof Error?Q.message:"Connection failed")}w(!1)}async function oe(){g&&(await Je.inspect.disconnect(g).catch(()=>{}),y(null),S([]),N([]))}async function X(){if(!(!g||!T.trim())){Z(!0);try{await Je.inspect.saveRecording(g,T.trim(),L.trim()||void 0),P(!1),O(""),V("")}catch(U){R(U instanceof Error?U.message:"Failed to save recording")}Z(!1)}}const ie=ee.some(U=>U.direction==="outgoing"&&U.method==="tools/call");return d.jsxs("div",{className:"space-y-6",children:[d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Inspector"}),g?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(dt,{variant:"success",children:"Connected"}),d.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.length," tools, ",C.length," resources"]}),ie&&d.jsxs(Me,{size:"sm",variant:"outline",onClick:()=>P(!0),children:[d.jsx(Ey,{className:"mr-2 h-4 w-4"}),"Save Recording"]}),d.jsxs(Me,{size:"sm",variant:"outline",onClick:oe,children:[d.jsx(aj,{className:"mr-2 h-4 w-4"}),"Disconnect"]})]}),j&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:"Save Recording"})}),d.jsxs(Xe,{className:"space-y-3",children:[d.jsx(Bt,{value:T,onChange:U=>O(U.target.value),placeholder:"Recording name"}),d.jsx(Bt,{value:L,onChange:U=>V(U.target.value),placeholder:"Description (optional)"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Me,{onClick:X,disabled:M||!T.trim(),children:[M?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Ey,{className:"mr-2 h-4 w-4"}),"Save"]}),d.jsx(Me,{variant:"outline",onClick:()=>P(!1),children:"Cancel"})]})]})]}),d.jsxs(up,{defaultValue:"tools",children:[d.jsxs(Vu,{children:[d.jsxs(ls,{value:"tools",children:["Tools (",_.length,")"]}),d.jsxs(ls,{value:"resources",children:["Resources (",C.length,")"]}),d.jsx(ls,{value:"call",children:"Call Tool"}),d.jsx(ls,{value:"protocol",children:"Protocol Log"})]}),d.jsx(cs,{value:"tools",className:"mt-4 space-y-3",children:_.map(U=>d.jsx(Ye,{children:d.jsxs(Xe,{className:"pt-4",children:[d.jsx("p",{className:"font-medium text-sm",children:U.name}),U.description&&d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:U.description}),U.inputSchema&&d.jsxs("details",{className:"mt-2",children:[d.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer",children:"Input Schema"}),d.jsx(sm,{data:U.inputSchema})]})]})},U.name))}),d.jsx(cs,{value:"resources",className:"mt-4 space-y-3",children:C.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No resources exposed"}):C.map(U=>d.jsx(Ye,{children:d.jsxs(Xe,{className:"pt-4",children:[d.jsx("p",{className:"font-medium text-sm",children:U.name??U.uri}),d.jsx("p",{className:"text-xs text-muted-foreground",children:U.uri}),U.description&&d.jsx("p",{className:"text-xs mt-1",children:U.description})]})},U.uri))}),d.jsxs(cs,{value:"call",className:"mt-4 space-y-4",children:[d.jsx(Ye,{children:d.jsx(Xe,{className:"pt-4",children:d.jsx(Y2,{sessionId:g,tools:_})})}),d.jsx(nO,{entries:ee})]}),d.jsx(cs,{value:"protocol",className:"mt-4",children:d.jsx(Ye,{children:d.jsx(Xe,{className:"pt-4",children:d.jsx(X2,{entries:ee})})})})]})]}):d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:"Connect to Server"})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs(up,{value:e,onValueChange:U=>t(U),children:[d.jsxs(Vu,{children:[d.jsx(ls,{value:"saved",children:"Saved Server"}),d.jsx(ls,{value:"custom",children:"Custom"})]}),d.jsx(cs,{value:"saved",className:"space-y-3 mt-3",children:d.jsxs(Pn,{value:n,onValueChange:i,children:[d.jsx(yn,{children:d.jsx(Tn,{placeholder:"Select a server"})}),d.jsx(xn,{children:(B=W.data)==null?void 0:B.data.map(U=>d.jsxs(ut,{value:U.id,children:[U.name," (",U.transport,")"]},U.id))})]})}),d.jsxs(cs,{value:"custom",className:"space-y-3 mt-3",children:[d.jsxs(Pn,{value:h,onValueChange:U=>m(U),children:[d.jsx(yn,{children:d.jsx(Tn,{})}),d.jsxs(xn,{children:[d.jsx(ut,{value:"stdio",children:"stdio"}),d.jsx(ut,{value:"sse",children:"SSE"}),d.jsx(ut,{value:"streamable-http",children:"Streamable HTTP"})]})]}),h==="stdio"?d.jsx(Bt,{value:o,onChange:U=>l(U.target.value),placeholder:"npx @modelcontextprotocol/server-filesystem /tmp"}):d.jsx(Bt,{value:u,onChange:U=>c(U.target.value),placeholder:"http://localhost:3000/sse"})]})]}),k&&d.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:k}),d.jsxs(Me,{onClick:se,disabled:x,className:"w-full",children:[x?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Uh,{className:"mr-2 h-4 w-4"}),"Connect"]})]})]})]})}function cd({title:e="Connect to Server",buttonLabel:t,onConnect:n,connecting:i,error:o,children:l,secondaryAction:u}){var T;const[c,h]=b.useState("saved"),[m,g]=b.useState(""),[y,x]=b.useState(""),[w,_]=b.useState(""),[S,C]=b.useState("stdio"),N=Ml();function k(){var O;if(c==="saved"){const L=(O=N.data)==null?void 0:O.data.find(V=>V.id===m);return L?{transport:L.transport,command:L.command,args:L.args,url:L.url,env:L.env}:null}else if(S==="stdio"){const L=y.split(/\s+/);return{transport:"stdio",command:L[0],args:L.slice(1)}}else return{transport:S,url:w}}async function R(){const O=k();O&&await n(O)}async function j(){if(!u)return;const O=k();O&&await u.onClick(O)}const P=c==="saved"?!!m:S==="stdio"?!!y:!!w;return d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:e})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs(up,{value:c,onValueChange:O=>h(O),children:[d.jsxs(Vu,{children:[d.jsx(ls,{value:"saved",children:"Saved Server"}),d.jsx(ls,{value:"custom",children:"Custom"})]}),d.jsx(cs,{value:"saved",className:"space-y-3 mt-3",children:d.jsxs(Pn,{value:m,onValueChange:g,children:[d.jsx(yn,{children:d.jsx(Tn,{placeholder:"Select a server"})}),d.jsx(xn,{children:(T=N.data)==null?void 0:T.data.map(O=>d.jsxs(ut,{value:O.id,children:[O.name," (",O.transport,")"]},O.id))})]})}),d.jsxs(cs,{value:"custom",className:"space-y-3 mt-3",children:[d.jsxs(Pn,{value:S,onValueChange:O=>C(O),children:[d.jsx(yn,{children:d.jsx(Tn,{})}),d.jsxs(xn,{children:[d.jsx(ut,{value:"stdio",children:"stdio"}),d.jsx(ut,{value:"sse",children:"SSE"}),d.jsx(ut,{value:"streamable-http",children:"Streamable HTTP"})]})]}),S==="stdio"?d.jsx(Bt,{value:y,onChange:O=>x(O.target.value),placeholder:"npx @modelcontextprotocol/server-filesystem /tmp"}):d.jsx(Bt,{value:w,onChange:O=>_(O.target.value),placeholder:"http://localhost:3000/sse"})]})]}),l,o&&d.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:o}),d.jsxs("div",{className:u?"flex gap-2":"",children:[u&&d.jsxs(Me,{variant:"outline",onClick:j,disabled:u.loading||i||!P,className:"flex-1",children:[u.loading?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Uh,{className:"mr-2 h-4 w-4"}),u.label]}),d.jsxs(Me,{onClick:R,disabled:i||!P,className:u?"flex-1":"w-full",children:[i?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Uh,{className:"mr-2 h-4 w-4"}),t??"Connect & Start"]})]})]})]})}const kh={critical:"bg-red-600 text-white",high:"bg-red-500 text-white",medium:"bg-orange-500 text-white",low:"bg-yellow-500 text-black",info:"bg-blue-500 text-white"};function iO(){const[e,t]=b.useState("setup"),[n,i]=b.useState("passive"),[o,l]=b.useState(""),[u,c]=b.useState(!1),[h,m]=b.useState(null),[g,y]=b.useState(null),[x,w]=b.useState(!1),[_,S]=b.useState(null),[C,N]=b.useState(null),[k,R]=b.useState(null),[j,P]=b.useState(0),[T,O]=b.useState(0),[L,V]=b.useState([]),[M,Z]=b.useState(null),[W,ee]=b.useState("all"),[se,oe]=b.useState(null),X=b.useCallback(te=>{if(!(te.type!=="event"||!g||te.channel!==`scan:${g}`))switch(te.event){case"rule-start":{const re=te.data;R(re.ruleName);break}case"rule-complete":{P(re=>re+1);break}case"finding":{const re=te.data;V(ve=>[...ve,re.finding]);break}case"completed":{g&&Je.audit.result(g).then(re=>{Z(re.data),t("results")}).catch(()=>{t("results")});break}case"error":{const re=te.data;m(re.message),t("setup");break}}},[g]),{subscribe:ie,connected:B}=ld({onMessage:X,enabled:!!g});b.useEffect(()=>{B&&g&&ie(`scan:${g}`)},[B,g,ie]);function U(){const te=o.trim();if(te)return te.split(",").map(re=>re.trim()).filter(Boolean)}async function Q(te){w(!0),m(null);try{const re=await Je.audit.dryRun({...te,mode:n,excludeTools:U()});S(re.data),N(te),t("preview")}catch(re){m(re instanceof Error?re.message:"Failed to run dry-run preview")}w(!1)}async function I(te){c(!0),m(null),V([]),P(0),R(null);try{const re=await Je.audit.start({...te,mode:n,excludeTools:U()});y(re.data.sessionId);const ve=await Je.audit.status(re.data.sessionId);ve.data.progress&&O(ve.data.progress.totalRules),t("scanning")}catch(re){m(re instanceof Error?re.message:"Failed to start audit")}c(!1)}async function Y(){C&&await I(C)}async function je(){g&&(await Je.audit.stop(g).catch(()=>{}),y(null),t("setup"))}function fe(){y(null),Z(null),V([]),P(0),R(null),m(null),S(null),N(null),t("setup")}const Ne=(M==null?void 0:M.findings.filter(te=>W==="all"||te.severity===W))??[];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(K0,{className:"h-8 w-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Security Audit"})]}),e==="setup"&&d.jsxs(cd,{title:"Start Security Audit",buttonLabel:"Start Scan",onConnect:I,connecting:u,error:h,secondaryAction:{label:"Preview Scan",loading:x,onClick:Q},children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Scan Mode"}),d.jsxs(Pn,{value:n,onValueChange:te=>i(te),children:[d.jsx(yn,{children:d.jsx(Tn,{})}),d.jsxs(xn,{children:[d.jsx(ut,{value:"passive",children:"Passive (safe, read-only probes)"}),d.jsx(ut,{value:"active",children:"Active (sends test payloads)"}),d.jsx(ut,{value:"aggressive",children:"Aggressive (extensive probing)"})]})]}),n!=="passive"&&d.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-700 dark:bg-amber-900/30 dark:text-amber-300",children:[d.jsx("strong",{children:"Warning:"})," ",n==="active"?"Active":"Aggressive"," mode sends potentially harmful payloads. Only use against test environments."]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Exclude Tools"}),d.jsx(Bt,{value:o,onChange:te=>l(te.target.value),placeholder:"tool1, tool2, ... (comma-separated)"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Tools to skip during scanning. Destructive-sounding tools are auto-skipped in active/aggressive mode."})]})]}),e==="preview"&&_&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(wt,{children:"Scan Preview"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Me,{variant:"outline",size:"sm",onClick:()=>t("setup"),children:[d.jsx(Qu,{className:"mr-2 h-4 w-4"}),"Back"]}),d.jsxs(Me,{size:"sm",onClick:Y,disabled:u,children:[u?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Wr,{className:"mr-2 h-4 w-4"}),"Run Scan"]})]})]})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsxs(dt,{variant:"outline",children:[_.mode," mode"]}),d.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.tools.filter(te=>te.included).length," of ",_.tools.length," tools will be scanned"]}),d.jsxs("span",{className:"text-sm text-muted-foreground",children:[_.rules.length," rule",_.rules.length!==1?"s":""]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-sm font-medium",children:"Rules"}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:_.rules.map(te=>d.jsx(dt,{variant:"secondary",children:te},te))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-sm font-medium",children:"Tools"}),d.jsxs("div",{className:"rounded-md border divide-y",children:[_.tools.map(te=>d.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[te.included?d.jsx(X_,{className:"h-4 w-4 text-green-600 flex-shrink-0"}):d.jsx(ha,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),d.jsx("span",{className:te.included?"text-sm":"text-sm text-muted-foreground line-through",children:te.name}),te.reason&&d.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:te.reason})]},te.name)),_.tools.length===0&&d.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"No tools found on server"})]})]})]})]}),e==="scanning"&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(wt,{className:"flex items-center gap-2",children:[d.jsx(or,{className:"h-5 w-5 animate-spin"}),"Scanning..."]}),d.jsxs(Me,{variant:"outline",size:"sm",onClick:je,children:[d.jsx(V0,{className:"mr-2 h-4 w-4"}),"Stop"]})]})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[d.jsx("span",{children:k?`Running: ${k}`:"Starting..."}),d.jsxs("span",{children:[j," / ",T," rules"]})]}),d.jsx("div",{className:"h-2 w-full rounded-full bg-muted",children:d.jsx("div",{className:"h-2 rounded-full bg-primary transition-all",style:{width:T>0?`${j/T*100}%`:"0%"}})})]}),d.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["critical","high","medium","low","info"].map(te=>{const re=L.filter(ve=>ve.severity===te).length;return re===0?null:d.jsxs(dt,{className:kh[te],children:[te,": ",re]},te)}),L.length===0&&d.jsx("span",{className:"text-sm text-muted-foreground",children:"No findings yet"})]})]})]}),e==="results"&&M&&d.jsxs(d.Fragment,{children:[d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(wt,{children:["Scan Results - ",M.serverName]}),d.jsx(Me,{variant:"outline",size:"sm",onClick:fe,children:"New Scan"})]})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-medium",children:"Mode:"}),d.jsx(dt,{variant:"outline",children:M.mode}),d.jsx("span",{className:"text-sm font-medium ml-4",children:"Total Findings:"}),d.jsx(dt,{variant:"secondary",children:M.summary.totalFindings})]}),d.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["critical","high","medium","low","info"].map(te=>{const re=M.summary.bySeverity[te];return re===0?null:d.jsxs(dt,{className:kh[te],children:[te,": ",re]},te)}),M.summary.totalFindings===0&&d.jsx("span",{className:"text-sm text-green-600 font-medium",children:"No vulnerabilities found"})]})]})]}),M.findings.length>0&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(wt,{children:"Findings"}),d.jsxs(Pn,{value:W,onValueChange:ee,children:[d.jsx(yn,{className:"w-40",children:d.jsx(Tn,{})}),d.jsxs(xn,{children:[d.jsx(ut,{value:"all",children:"All Severities"}),d.jsx(ut,{value:"critical",children:"Critical"}),d.jsx(ut,{value:"high",children:"High"}),d.jsx(ut,{value:"medium",children:"Medium"}),d.jsx(ut,{value:"low",children:"Low"}),d.jsx(ut,{value:"info",children:"Info"})]})]})]})}),d.jsx(Xe,{children:d.jsx("div",{className:"space-y-2",children:Ne.map(te=>d.jsxs("div",{className:"rounded-md border",children:[d.jsxs("button",{className:"flex w-full items-center gap-3 p-3 text-left hover:bg-muted/50 transition-colors",onClick:()=>oe(se===te.id?null:te.id),children:[se===te.id?d.jsx(z0,{className:"h-4 w-4 flex-shrink-0"}):d.jsx(Y_,{className:"h-4 w-4 flex-shrink-0"}),d.jsx(dt,{className:`${kh[te.severity]} flex-shrink-0`,children:te.severity}),d.jsx("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:te.rule}),d.jsx("span",{className:"text-sm font-medium truncate",children:te.title})]}),se===te.id&&d.jsxs("div",{className:"border-t px-3 py-3 space-y-2 bg-muted/20",children:[d.jsx("p",{className:"text-sm",children:te.description}),te.evidence&&d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Evidence"}),d.jsx("pre",{className:"rounded bg-muted p-2 text-xs overflow-x-auto",children:te.evidence})]}),te.remediation&&d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Remediation"}),d.jsx("p",{className:"text-sm",children:te.remediation})]})]})]},te.id))})})]})]})]})}function oO(){const[e,t]=b.useState("connect"),[n,i]=b.useState(!1),[o,l]=b.useState(null),[u,c]=b.useState(null),[h,m]=b.useState([]),[g,y]=b.useState(""),[x,w]=b.useState("{}"),[_,S]=b.useState("100"),[C,N]=b.useState("5"),[k,R]=b.useState(null),[j,P]=b.useState("warmup"),[T,O]=b.useState(0),[L,V]=b.useState(0),[M,Z]=b.useState(null),W=b.useCallback(Q=>{if(!(Q.type!=="event"||!k||Q.channel!==`benchmark:${k}`))switch(Q.event){case"warmup-start":{P("warmup");break}case"iteration":{const I=Q.data;P("measuring"),O(I.iteration);break}case"completed":{const I=Q.data;Z(I.result),t("results");break}case"error":{const I=Q.data;l(I.message),t("connect");break}}},[k]),{subscribe:ee,connected:se}=ld({onMessage:W,enabled:!!k});b.useEffect(()=>{se&&k&&ee(`benchmark:${k}`)},[se,k,ee]);async function oe(Q){i(!0),l(null);try{const I=await Je.inspect.connect({transport:Q.transport,command:Q.command,args:Q.args,url:Q.url,env:Q.env}),Y=await Je.inspect.tools(I.data.sessionId);m(Y.data),c(Q),await Je.inspect.disconnect(I.data.sessionId).catch(()=>{}),Y.data.length>0&&y(Y.data[0].name),t("setup")}catch(I){l(I instanceof Error?I.message:"Failed to connect")}i(!1)}async function X(){if(!(!u||!g)){l(null),O(0),V(parseInt(_,10)),P("warmup");try{let Q={};try{Q=JSON.parse(x)}catch{l("Invalid JSON in tool arguments");return}const I=await Je.benchmark.start({...u,tool:g,toolArgs:Q,iterations:parseInt(_,10),warmup:parseInt(C,10)});R(I.data.sessionId),t("running")}catch(Q){l(Q instanceof Error?Q.message:"Failed to start benchmark")}}}async function ie(){k&&(await Je.benchmark.stop(k).catch(()=>{}),R(null),t("setup"))}function B(){R(null),Z(null),O(0),l(null),t("connect"),c(null),m([]),y("")}function U(Q){return Q.toFixed(2)}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(q0,{className:"h-8 w-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Performance Benchmark"})]}),e==="connect"&&d.jsx(cd,{title:"Connect to Server",onConnect:oe,connecting:n,error:o}),e==="setup"&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(wt,{children:"Configure Benchmark"}),d.jsxs(dt,{variant:"success",children:[h.length," tools available"]})]})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Tool"}),d.jsxs(Pn,{value:g,onValueChange:y,children:[d.jsx(yn,{children:d.jsx(Tn,{placeholder:"Select a tool"})}),d.jsx(xn,{children:h.map(Q=>d.jsxs(ut,{value:Q.name,children:[Q.name,Q.description?` - ${Q.description}`:""]},Q.name))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Tool Arguments (JSON)"}),d.jsx(Bt,{value:x,onChange:Q=>w(Q.target.value),placeholder:'{"path": "/tmp"}',className:"font-mono text-sm"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Iterations"}),d.jsx(Bt,{type:"number",value:_,onChange:Q=>S(Q.target.value),min:"1"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Warmup Iterations"}),d.jsx(Bt,{type:"number",value:C,onChange:Q=>N(Q.target.value),min:"0"})]})]}),o&&d.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:o}),d.jsxs(Me,{onClick:X,disabled:!g,className:"w-full",children:[d.jsx(Wr,{className:"mr-2 h-4 w-4"}),"Run Benchmark"]})]})]}),e==="running"&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(wt,{className:"flex items-center gap-2",children:[d.jsx(or,{className:"h-5 w-5 animate-spin"}),"Running Benchmark"]}),d.jsxs(Me,{variant:"outline",size:"sm",onClick:ie,children:[d.jsx(V0,{className:"mr-2 h-4 w-4"}),"Stop"]})]})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-medium",children:"Tool:"}),d.jsx(dt,{variant:"outline",children:g}),d.jsx("span",{className:"text-sm font-medium ml-4",children:"Phase:"}),d.jsx(dt,{variant:j==="warmup"?"secondary":"default",children:j==="warmup"?"Warmup":"Measuring"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[d.jsx("span",{children:j==="warmup"?"Warming up...":`Iteration ${T} / ${L}`}),L>0&&j==="measuring"&&d.jsxs("span",{children:[(T/L*100).toFixed(0),"%"]})]}),d.jsx("div",{className:"h-2 w-full rounded-full bg-muted",children:d.jsx("div",{className:"h-2 rounded-full bg-primary transition-all",style:{width:j==="warmup"?"0%":L>0?`${T/L*100}%`:"0%"}})})]})]})]}),e==="results"&&M&&d.jsx(d.Fragment,{children:d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(wt,{children:["Benchmark Results - ",M.toolName]}),d.jsx(Me,{variant:"outline",size:"sm",onClick:B,children:"New Benchmark"})]})}),d.jsxs(Xe,{className:"space-y-6",children:[d.jsxs("div",{className:"flex gap-3 flex-wrap",children:[d.jsxs(dt,{variant:"outline",children:[M.iterations," iterations"]}),d.jsxs(dt,{variant:"outline",children:[M.errors," errors"]}),M.iterations>0&&d.jsxs(dt,{variant:"outline",children:[(M.errors/M.iterations*100).toFixed(1),"% error rate"]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[d.jsx(Ks,{label:"Min",value:`${U(M.stats.min)} ms`}),d.jsx(Ks,{label:"Max",value:`${U(M.stats.max)} ms`}),d.jsx(Ks,{label:"Mean",value:`${U(M.stats.mean)} ms`}),d.jsx(Ks,{label:"Median",value:`${U(M.stats.median)} ms`}),d.jsx(Ks,{label:"P95",value:`${U(M.stats.p95)} ms`}),d.jsx(Ks,{label:"P99",value:`${U(M.stats.p99)} ms`}),d.jsx(Ks,{label:"Std Dev",value:`${U(M.stats.stddev)} ms`}),d.jsx(Ks,{label:"Throughput",value:(()=>{const Q=new Date(M.startedAt).getTime(),Y=(new Date(M.completedAt).getTime()-Q)/1e3;return Y>0?`${(M.iterations/Y).toFixed(1)} calls/sec`:"N/A"})()})]})]})]})})]})}function Ks({label:e,value:t}){return d.jsxs("div",{className:"rounded-md border p-3",children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:e}),d.jsx("p",{className:"text-lg font-semibold",children:t})]})}function aO(){const[e,t]=b.useState("setup"),[n,i]=b.useState("markdown"),[o,l]=b.useState(!1),[u,c]=b.useState(null),[h,m]=b.useState(""),[g,y]=b.useState(!1);async function x(C){l(!0),c(null);try{const N=await Je.docs.generate({...C,format:n});m(N.data.content),t("results")}catch(N){c(N instanceof Error?N.message:"Failed to generate documentation")}l(!1)}function w(){navigator.clipboard.writeText(h),y(!0),setTimeout(()=>y(!1),2e3)}function _(){const C=n==="html"?"index.html":"README.md",N=n==="html"?"text/html":"text/markdown",k=new Blob([h],{type:N}),R=URL.createObjectURL(k),j=document.createElement("a");j.href=R,j.download=C,j.click(),URL.revokeObjectURL(R)}function S(){t("setup"),m(""),c(null)}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(B0,{className:"h-8 w-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Documentation"})]}),e==="setup"&&d.jsx(cd,{title:"Generate Documentation",onConnect:x,connecting:o,error:u,children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Output Format"}),d.jsxs(Pn,{value:n,onValueChange:C=>i(C),children:[d.jsx(yn,{children:d.jsx(Tn,{})}),d.jsxs(xn,{children:[d.jsx(ut,{value:"markdown",children:"Markdown"}),d.jsx(ut,{value:"html",children:"HTML"})]})]})]})}),e==="results"&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(wt,{children:["Generated Documentation (",n.toUpperCase(),")"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Me,{variant:"outline",size:"sm",onClick:w,children:[d.jsx(ej,{className:"mr-2 h-4 w-4"}),g?"Copied!":"Copy"]}),d.jsxs(Me,{variant:"outline",size:"sm",onClick:_,children:[d.jsx($0,{className:"mr-2 h-4 w-4"}),"Download"]}),d.jsxs(Me,{variant:"outline",size:"sm",onClick:S,children:[d.jsx(Qu,{className:"mr-2 h-4 w-4"}),"Back"]})]})]})}),d.jsx(Xe,{children:d.jsx("pre",{className:"max-h-[600px] overflow-auto rounded-md bg-muted p-4 text-sm",children:d.jsx("code",{children:h})})})]})]})}function lO(e){return e>=80?"bg-green-500":e>=60?"bg-yellow-500":"bg-red-500"}function Ux(e){return e>=80?"text-green-600":e>=60?"text-yellow-600":"text-red-600"}const Wx={documentation:"Documentation",schemaQuality:"Schema Quality",errorHandling:"Error Handling",responsiveness:"Responsiveness",security:"Security"};function cO(){const[e,t]=b.useState("setup"),[n,i]=b.useState(!1),[o,l]=b.useState(null),[u,c]=b.useState(null),[h,m]=b.useState(null),[g,y]=b.useState(null),x=b.useCallback(k=>{if(!(k.type!=="event"||!h||!k.channel.startsWith(`score:${h}`)))switch(k.event){case"category-start":{const R=k.data;c(R.category);break}}},[h]),{subscribe:w,connected:_}=ld({onMessage:x,enabled:!!h&&e==="calculating"});b.useEffect(()=>{_&&h&&w(`score:${h}`)},[_,h,w]);async function S(k){i(!0),l(null),c(null),t("calculating");try{const R=await Je.score.calculate(k);m(R.data.sessionId),y(R.data.score),t("results")}catch(R){l(R instanceof Error?R.message:"Failed to calculate score"),t("setup")}i(!1)}async function C(){if(g)try{const k=await Je.score.badge(g),R=new Blob([k.data.svg],{type:"image/svg+xml"}),j=URL.createObjectURL(R),P=document.createElement("a");P.href=j,P.download="mcp-score-badge.svg",P.click(),URL.revokeObjectURL(j)}catch{}}function N(){t("setup"),y(null),m(null),l(null),c(null)}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Q0,{className:"h-8 w-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"MCP Score"})]}),e==="setup"&&d.jsx(cd,{title:"Calculate MCP Score",onConnect:S,connecting:n,error:o}),e==="calculating"&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs(wt,{className:"flex items-center gap-2",children:[d.jsx(or,{className:"h-5 w-5 animate-spin"}),"Calculating Score..."]})}),d.jsx(Xe,{children:d.jsx("p",{className:"text-sm text-muted-foreground",children:u?`Evaluating ${Wx[u]??u}...`:"Connecting to server..."})})]}),e==="results"&&g&&d.jsxs(d.Fragment,{children:[d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(wt,{children:"Overall Score"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Me,{variant:"outline",size:"sm",onClick:C,children:[d.jsx($0,{className:"mr-2 h-4 w-4"}),"Download Badge"]}),d.jsxs(Me,{variant:"outline",size:"sm",onClick:N,children:[d.jsx(Qu,{className:"mr-2 h-4 w-4"}),"Back"]})]})]})}),d.jsx(Xe,{children:d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:`text-6xl font-bold ${Ux(g.overall)}`,children:g.overall}),d.jsx("div",{className:"text-lg text-muted-foreground mt-1",children:"out of 100"})]})})})]}),d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:"Category Breakdown"})}),d.jsx(Xe,{className:"space-y-4",children:Object.entries(g.categories).map(([k,R])=>d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsx("span",{className:"font-medium",children:Wx[k]??k}),d.jsxs("span",{className:Ux(R),children:[R,"/100"]})]}),d.jsx("div",{className:"h-3 w-full rounded-full bg-muted",children:d.jsx("div",{className:`h-3 rounded-full transition-all ${lO(R)}`,style:{width:`${R}%`}})})]},k))})]})]})]})}function uO({type:e}){const n={matched:{className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",label:"Matched"},changed:{className:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",label:"Changed"},added:{className:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",label:"Added"},removed:{className:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",label:"Removed"}}[e]??{className:"bg-gray-100 text-gray-800",label:e};return d.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${n.className}`,children:n.label})}function dO(){var k,R;const e=Kr(),t=Ml(),[n,i]=b.useState(null),[o,l]=b.useState(""),[u,c]=b.useState(""),[h,m]=b.useState("saved"),[g,y]=b.useState(null),x=Al({queryKey:["recordings"],queryFn:()=>Je.recordings.list()}),w=_r({mutationFn:j=>Je.recordings.delete(j),onSuccess:()=>e.invalidateQueries({queryKey:["recordings"]})}),_=_r({mutationFn:async({id:j,connectData:P})=>(await Je.recordings.replay(j,P)).data,onSuccess:j=>{y(j),i(null)}});function S(j){try{return JSON.parse(j.data)}catch{return null}}function C(){var P;if(!n)return;let j;if(h==="saved"){const T=(P=t.data)==null?void 0:P.data.find(O=>O.id===o);if(!T)return;j={transport:T.transport,command:T.command,args:T.args,url:T.url,env:T.env}}else{const T=u.split(/\s+/);j={transport:"stdio",command:T[0],args:T.slice(1)}}_.mutate({id:n,connectData:j})}const N=((k=x.data)==null?void 0:k.data)??[];return d.jsxs("div",{className:"space-y-6",children:[d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Recordings"}),n&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsx(wt,{children:"Replay Recording"})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Me,{size:"sm",variant:h==="saved"?"default":"outline",onClick:()=>m("saved"),children:"Saved Server"}),d.jsx(Me,{size:"sm",variant:h==="custom"?"default":"outline",onClick:()=>m("custom"),children:"Custom"})]}),h==="saved"?d.jsxs(Pn,{value:o,onValueChange:l,children:[d.jsx(yn,{children:d.jsx(Tn,{placeholder:"Select a server"})}),d.jsx(xn,{children:(R=t.data)==null?void 0:R.data.map(j=>d.jsxs(ut,{value:j.id,children:[j.name," (",j.transport,")"]},j.id))})]}):d.jsx(Bt,{value:u,onChange:j=>c(j.target.value),placeholder:"npx @modelcontextprotocol/server-filesystem /tmp"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Me,{onClick:C,disabled:_.isPending,children:[_.isPending?d.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}):d.jsx(Wr,{className:"mr-2 h-4 w-4"}),"Replay"]}),d.jsx(Me,{variant:"outline",onClick:()=>i(null),children:"Cancel"})]}),_.error&&d.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-200",children:_.error.message})]})]}),g&&d.jsxs(Ye,{children:[d.jsx(xt,{children:d.jsxs(wt,{children:["Replay Results: ",g.recordingName]})}),d.jsxs(Xe,{className:"space-y-4",children:[d.jsxs("div",{className:"flex gap-4 text-sm",children:[d.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["Matched: ",g.summary.matched]}),d.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:["Changed: ",g.summary.changed]}),d.jsxs("span",{className:"text-blue-600 dark:text-blue-400",children:["Added: ",g.summary.added]}),d.jsxs("span",{className:"text-red-600 dark:text-red-400",children:["Removed: ",g.summary.removed]})]}),d.jsx("div",{className:"space-y-2",children:g.steps.map(j=>d.jsxs("div",{className:"flex items-center gap-3 rounded-md border p-3 text-sm",children:[d.jsx("span",{className:"font-mono text-muted-foreground w-6",children:j.index+1}),d.jsx("span",{className:"font-medium",children:j.tool}),d.jsx(uO,{type:j.type}),j.outputDiff&&d.jsx("span",{className:"text-xs text-muted-foreground",children:j.outputDiff})]},j.index))}),d.jsx(Me,{variant:"outline",size:"sm",onClick:()=>y(null),children:"Close"})]})]}),N.length===0?d.jsx(Ye,{children:d.jsx(Xe,{className:"pt-6",children:d.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-center text-muted-foreground",children:[d.jsx(Z0,{className:"h-12 w-12 opacity-50"}),d.jsx("p",{children:"No recordings yet."}),d.jsx("p",{className:"text-sm",children:"Use the Inspector to connect to a server, make tool calls, then save a recording."})]})})}):d.jsx("div",{className:"space-y-3",children:N.map(j=>{const P=S(j);return d.jsx(Ye,{children:d.jsxs(Xe,{className:"flex items-center justify-between pt-4",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium",children:j.name}),d.jsxs("div",{className:"flex gap-2 mt-1 text-xs text-muted-foreground",children:[j.serverName&&d.jsxs("span",{children:["Server: ",j.serverName]}),P&&d.jsxs("span",{children:[P.steps.length," steps"]}),d.jsx("span",{children:new Date(j.createdAt).toLocaleString()})]}),j.description&&d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:j.description})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Me,{size:"sm",variant:"outline",onClick:()=>{i(j.id),y(null)},children:[d.jsx(Wr,{className:"mr-1 h-3 w-3"}),"Replay"]}),d.jsx(Me,{size:"sm",variant:"ghost",onClick:()=>w.mutate(j.id),disabled:w.isPending,children:d.jsx(pa,{className:"h-4 w-4 text-red-500"})})]})]})},j.id)})})]})}const cr=O_({component:function(){const t=Hn(),n=t.state.location.pathname;return d.jsx(qj,{currentPath:n,onNavigate:i=>t.navigate({to:i}),children:d.jsx(F0,{})})}}),fO=ar({getParentRoute:()=>cr,path:"/",component:yE}),hO=ar({getParentRoute:()=>cr,path:"/servers",component:m2}),pO=ar({getParentRoute:()=>cr,path:"/collections",component:S2}),mO=ar({getParentRoute:()=>cr,path:"/runs",component:C2}),gO=ar({getParentRoute:()=>cr,path:"/runs/$runId",component:j2}),vO=ar({getParentRoute:()=>cr,path:"/inspect",component:sO}),yO=ar({getParentRoute:()=>cr,path:"/audit",component:iO}),xO=ar({getParentRoute:()=>cr,path:"/benchmark",component:oO}),wO=ar({getParentRoute:()=>cr,path:"/docs",component:aO}),SO=ar({getParentRoute:()=>cr,path:"/score",component:cO}),bO=ar({getParentRoute:()=>cr,path:"/recordings",component:dO}),CO=cr.addChildren([fO,hO,pO,mO,gO,vO,yO,xO,wO,SO,bO]),gs=V_({routeTree:CO});Hh.getState().initTheme();const kO=new OC({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}});lC.createRoot(document.getElementById("root")).render(d.jsx(b.StrictMode,{children:d.jsx(AC,{client:kO,children:d.jsx(U_,{router:gs})})}));
361
- //# sourceMappingURL=index-5z8Daqpj.js.map
361
+ //# sourceMappingURL=index-DVfkVPeT.js.map