(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,358370,e=>{"use strict";var l=e.i(659350),t=e.i(663456),r=e.i(139697),n=e.i(670168),a=e.i(618115);e.i(707060);var s=e.i(196991),i=e.i(819750),c=e.i(524287),o=e.i(497214),u=e.i(430022),m=e.i(647204),d=e.i(882844),h=e.i(635157);let f={"stealth/union-alpha":"unbiased/pareto-20260917"},x=["terminal_bench"],p=h.z.object({id:h.z.string(),workflow_id:h.z.string(),benchmark_type:h.z.string(),model_permaslug:h.z.string(),provider_name:h.z.string(),timestamp:h.z.string(),resumed_from_workflow_id:h.z.string().nullable(),config_key:h.z.string(),reasoning_effort:h.z.string().nullable(),max_tokens:h.z.string().nullable(),cost_tier:h.z.string().nullable().default(null),route_models:h.z.array(h.z.string()).nullable(),temperature:h.z.number().nullable(),sample_limit:h.z.number().nullable(),epochs:h.z.number().nullable(),recorded_epochs:h.z.coerce.number(),accuracy:h.z.coerce.number(),total_questions:h.z.coerce.number(),correct_answers:h.z.coerce.number(),total_cost:h.z.coerce.number().nullable(),generation_time_ms:h.z.coerce.number().nullable(),duration_ms:h.z.coerce.number(),input_tokens:h.z.coerce.number().nullable(),output_tokens:h.z.coerce.number().nullable(),reasoning_tokens:h.z.coerce.number().nullable(),success:h.z.boolean(),baseline:h.z.boolean().default(!1)}),b=h.z.object({runs:h.z.array(p),truncated:h.z.boolean()}),g=h.z.object({workflow_id:h.z.string(),model_permaslug:h.z.string(),calls:h.z.coerce.number(),spend:h.z.coerce.number().nullable(),input_tokens:h.z.coerce.number().nullable(),cached_tokens:h.z.coerce.number().nullable(),requests_with_tool_calls:h.z.coerce.number().nullable(),requests_with_tool_call_errors:h.z.coerce.number().nullable()}),j=h.z.object({models:h.z.array(g),available:h.z.boolean()});var y=e.i(173465),_=e.i(238819);let w="/api/frontend/v1/stats/router-benchmarks";var k=e.i(393182),v=e.i(956822);let S="auto-routing",N=["quality","cache","costPerSuccess","cost","speed","score"],T=v.o,M={"switchyard/benchmark-always-opus":["anthropic/claude-opus-4.6"],"switchyard/benchmark-always-glm":["z-ai/glm-5"]},C="unbiased/pareto",z={[k.f.JevRouter]:v.B.Medium},q="auto-routing",R=new Set([q,"OpenRouter"]);function B(e){return e===k.f.Switchyard||e.startsWith("switchyard/")}function P(e){var l,t;let r={...e,model_permaslug:(l=e.model_permaslug)===C||l.startsWith(`${C}-`)?C:e.model_permaslug,provider_name:(t=e.provider_name,R.has(t)?q:t)},n=z[r.model_permaslug];return void 0===n?r:{...r,cost_tier:r.cost_tier??n}}function $(e){let l=H(e.model,e.routeModels);return 1===l.length?l[0]??null:null}function F(e){return null!==$(e)}function L(e){return e.columns.filter(e=>null!==e.costTier).length>1}function A(e,l){if(null===e||null===l)return Number(null!==e)-Number(null!==l);let t=e=>{let l=T.indexOf(e);return -1===l?T.length:l};return t(e)-t(l)||D(e,l)}function H(e,l){return e===k.f.Switchyard?l??[]:M[e]??[]}function I(e){return V(e)?[e.model_permaslug]:e.model_permaslug===k.f.Switchyard&&e.route_models&&e.route_models.length>0?e.route_models:null}function V(e){return e.baseline&&!B(e.model_permaslug)}function O(e){return V(e)?k.f.Switchyard:e.model_permaslug}function E(e){return V(e)?S:e.provider_name}function J(e){return B(O(e))?e.reasoning_effort:null}function Q(e){return JSON.stringify([O(e),E(e),I(e),J(e),e.cost_tier])}function K(e){return JSON.stringify([e.model,e.provider,e.routeModels,e.reasoningEffort])}function U(e,l){return D(e.family,l.family)||D(e.provider,l.provider)||D(e.key,l.key)}function D(e,l){return Number(e>l)-Number(e0&&(null===e.epochs||0===e.recorded_epochs||e.recorded_epochs>=e.epochs)}function G(e,l){switch(l){case"quality":return e.total_questions>0?e.accuracy:null;case"cost":return Z(e.total_cost,e.total_questions);case"costPerSuccess":return Z(e.total_cost,e.correct_answers);case"speed":return Z(e.generation_time_ms,e.total_questions);case"cache":case"score":return null;default:return l}}function Z(e,l){return null!==e&&l>0?e/l:null}function X(e,l){return 0===e.length||e.some(e=>null===e[l])?null:e.reduce((e,t)=>e+(t[l]??0),0)}let Y=(0,c.f)("router-benchmarks",{results:()=>[],usage:e=>[e]});function ee(e){return(0,y.f)({queryKey:Y.usage(e),queryFn:({signal:l})=>(0,i.f)(`${w}/usage`,{signal:l,searchParams:{ids:e.join(",")}}).then(e=>(0,m.u)((0,d.C)(j,e)))})}function el(e){return{models:e.flatMap(en),isPending:e.some(er),isError:e.some(et)}}function et(e){return e.isError}function er(e){return e.isPending}function en(e){return e.data?.models??[]}function ea(e){return(0,o._)(e.map(es).toSorted(),64)}function es(e){return e.id}function ei(e){return Math.floor(Date.parse(e.timestamp)/u.b)}var ec=e.i(138257),eo=e.i(153746),eu=e.i(288265),em=e.i(651681);let ed={name:"chart-no-axes-combined",size:24,node:[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14.639V21",key:"1s85h0"}],["path",{d:"M20 10.656V21",key:"q45596"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18.463V21",key:"1otddq"}],["path",{d:"M8 14.656V21",key:"1t2idw"}]]};ed.node;let eh=(0,em.f)(ed);var ef=e.i(917258),ex=e.i(74303),ex=ex,ep=e.i(19773),eb=e.i(16043);function eg(e){let r,n,a=(0,t.c)(6),{prefix:s,freshness:i}=e;return a[0]!==i.iso||a[1]!==i.label?(r=(0,l.jsx)("time",{dateTime:i.iso,children:i.label}),a[0]=i.iso,a[1]=i.label,a[2]=r):r=a[2],a[3]!==s||a[4]!==r?(n=(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:[s," ",r]}),a[3]=s,a[4]=r,a[5]=n):n=a[5],n}var ej=e.i(897550),ey=e.i(714170),e_=e.i(983330),ew=e.i(770292),ek=e.i(32959);let ev={tau_bench_verified_airline:"tau2-bench-airline"},eS={tau3_bench_banking:"Tau3 Banking",tau_bench_airline:"τ-bench Airline",terminal_bench:"Terminal Bench 2.1","terminal-bench-4.0":"Terminal Bench 4.0"},eN=new Set(["swe","mmmu","qa","gpqa","hle"]),eT={[C]:"Pareto",[k.f.Switchyard]:"Switchyard",[k.f.JevRouter]:"Jev Router"},eM={"switchyard/benchmark-always-opus":"Always Opus","switchyard/benchmark-always-glm":"Always GLM"};function eC(e){let l=ev[e]??e.replaceAll("_","-");return(0,ek.r)().find(t=>t.slug===l||"search"===t.source.kind&&t.source.suite===e)}function ez(e){return eS[e]??eC(e)?.name??e.replaceAll("_"," ").replaceAll(/\b\w+\b/g,e=>eN.has(e.toLowerCase())?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1))}function eq(e){return eP({model:e.model_permaslug,provider:e.provider_name,routeModels:e.route_models,reasoningEffort:e.reasoning_effort,costTier:e.cost_tier})}function eR(e,l="auto-routing"){let t=eL(e);return"auto-routing"===l?t:`${t} \xb7 ${l}`}function eB(e,l){let t=eM[e];if(void 0!==t)return t;if(null===l||0===l.length)return eL(e);let r=l.map(eL).join(" + ");return 1===l.length?`Always ${r}`:r}function eP(e){var l,t,r;let n,a,s,i=e$(...null!==(n=$(l=e))?[eL(n),l]:B(l.model)?[(t=l.model,r=l.routeModels,a=eL(k.f.Switchyard),(s=eB(t,r))===a?a:`${a} \xb7 ${s}`),l]:[eL(l.model),{reasoningEffort:null,costTier:l.costTier}]);return"auto-routing"===e.provider?i:`${i} \xb7 ${e.provider}`}function e$(e,{reasoningEffort:l,costTier:t}){var r;let n=null===t?null:(r=t,`${r.charAt(0).toUpperCase()}${r.slice(1)}`);return null!==l&&null!==n?`${e} (${l}, ${n} tier)`:null!==n?`${e} (${n} tier)`:null===l?e:`${e} (${l})`}function eF(e){return e===C?"/~unbiased/pareto-latest":`/${B(e)?k.f.Switchyard:e}`}function eL(e){return eT[e]??(0,ew.b)(e).replaceAll(/\bV(\d+)/g,"v$1")}var eA=e.i(136562),eH=e.i(645364);let eI=new Set(["hle","tau2-bench-airline"]),eV=new Set(["sakana/fugu-ultra"]),eO=["deep_swe","swe_atlas_qa","terminal-bench-4.0","tau3_bench_banking","mmmu_pro_vision","gpqa_diamond"];function eE(e){return e.filter(e=>{var l;let t;return l=e.benchmark,!(void 0!==(t=eC(l)?.slug)&&eI.has(t))}).map(e=>({...e,cells:e.cells.filter(e=>!eV.has(e.column.model)&&!eV.has($(e.column)??""))})).filter(e=>e.cells.some(e=>null!==e.run))}function eJ(e){let l=eO.indexOf(e.benchmark);return -1===l?eO.length:l}function eQ(e){return e.cells.filter(({run:e,column:l})=>null!==e&&W(e)&&!F(l)).length}function eK(e,l){return Number(F(e))-Number(F(l))||eD(eP(e),eP(l))}function eU(e){return e.family===k.f.Switchyard}function eD(e,l){return eW(e.toLowerCase(),l.toLowerCase())||eW(e,l)}function eW(e,l){return Number(e>l)-Number(ef(e||null),m[0]=f,m[1]=r):r=m[1],m[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,l.jsx)(eG.SelectValue,{}),m[2]=n):n=m[2],m[3]!==x||m[4]!==p?(a=(0,l.jsx)(eG.SelectTrigger,{"aria-label":x,className:p,children:n}),m[3]=x,m[4]=p,m[5]=a):a=m[5],m[6]!==g||m[7]!==j?(s=g??j("All benchmarks"),m[6]=g,m[7]=j,m[8]=s):s=m[8],m[9]!==s?(i=(0,l.jsx)(eG.SelectItem,{value:"",children:s}),m[9]=s,m[10]=i):i=m[10],m[11]!==h?(c=h.map(eY),m[11]=h,m[12]=c):c=m[12],m[13]!==i||m[14]!==c?(o=(0,l.jsxs)(eG.SelectContent,{children:[i,c]}),m[13]=i,m[14]=c,m[15]=o):o=m[15],m[16]!==b||m[17]!==y||m[18]!==r||m[19]!==a||m[20]!==o?(u=(0,l.jsxs)(eG.Select,{value:y,onValueChange:r,size:b,children:[a,o]}),m[16]=b,m[17]=y,m[18]=r,m[19]=a,m[20]=o,m[21]=u):u=m[21],u}function eY(e){return(0,l.jsx)(eG.SelectItem,{value:e.benchmark,children:ez(e.benchmark)},e.benchmark)}var e0=e.i(530798),e1=e.i(460867),e2=e.i(220535),e3=e.i(465775),e4=e.i(790608),e5=e.i(336810),e6=e.i(511667);let e7=["quality","cost","costPerSuccess","speed"],e8=["quality","speed","cost"],e9={quality:60,speed:20,cost:20};function le(e,l){let t=G(e,l);return null===t||!Number.isFinite(t)||t<0?null:0!==t||ll(l)?t:null}function ll(e){switch(e){case"quality":return!0;case"cost":case"costPerSuccess":case"speed":return!1;default:return e}}function lt(e,{metric:l,usage:t,scorePortions:r=e9}){var n,a;let s,i,c,o=("score"===l?(n=e,a=r,i=(s=n.cells.flatMap(e=>e.run&&W(e.run)?[{cell:e,run:e.run}]:[])).flatMap(({cell:e,run:l})=>F(e.column)?[]:[l]),c=new Map((function(e,{anchors:l=[],portions:t=e9}={}){let r=l.length>0?l:e,n={quality:t.quality/100,speed:t.speed/100,cost:t.cost/100/2,costPerSuccess:t.cost/100/2},a=e7.map(l=>{var t,n;let a,s=e.map(e=>le(e,l)),i=(t=r.map(e=>le(e,l)),n=l,0===(a=t.filter(e=>null!==e&&(ll(n)||e>0))).length?null:ll(n)?Math.max(...a):Math.min(...a));return s.map(e=>null===e?null:function(e,{best:l,component:t}){return null===l?null:ll(t)?0===l?Number(e>0):Math.min(1,e/l):Math.min(1,Math.max(0,1-Math.log10(e/l)/2))}(e,{best:i,component:l}))});return e.map((e,l)=>{let t=e7.flatMap((e,t)=>{let r=a[t]?.[l];return null==r?[]:[{score:r,weight:n[e]}]}),r=t.reduce((e,l)=>e+l.weight,0);return 0===r?null:10*t.reduce((e,l)=>e+l.score*l.weight,0)/r})})(s.map(({run:e})=>e),{anchors:i,portions:a}).map((e,l)=>[s[l]?.cell.key,e])),n.cells.map(e=>{let l=c.get(e.key)??null;return{cell:e,value:l,isComparable:null!==l}})):function(e,{metric:l,usage:t}){return e.cells.map(e=>{var r;let n,a,{run:s}=e;if(!s)return{cell:e,value:null,isComparable:!1};let i="cache"===l?(n=X(r=t.filter(e=>e.workflow_id===s.workflow_id),"input_tokens"),a=X(r,"cached_tokens"),null===n||null===a||a<0||a>n?null:Z(a,n)):G(s,l),c=W(s)&&null!==i&&Number.isFinite(i);return{cell:e,value:i,isComparable:c}})}(e,{metric:l,usage:t})).map(e=>({...e,isComparable:e.isComparable&&!F(e.cell.column)})),u=o.flatMap(({value:e,isComparable:l})=>l&&null!==e?[e]:[]),m=Math.min(...u),d=Math.max(...u),h="quality"===l||"cache"===l||"score"===l;return o.map(({cell:e,value:l,isComparable:t})=>{if(!t||null===l||u.length<2)return{cell:e,value:l,isBest:!1,heat:null};let r=d===m?0:(h?d-l:l-m)/(d-m);return{cell:e,value:l,isBest:0===r,heat:r}})}let lr=["cost","costPerSuccess","speed"],ln={quality:100,speed:0,cost:0},la=new Set([k.f.Auto,k.f.JevRouter]);function ls(e){return JSON.stringify([e.family,e.provider,la.has(e.family)?e.costTier:null])}function li(e){return e.reduce((e,l)=>e+l,0)/e.length}let lc={cost:"cost",costPerSuccess:"cost",speed:"latency"};function lo(e){let r,n,a,i,c,o,u,m,d,h,f,x,p,b,g,j,y,_,w,N=(0,t.c)(43),{rows:T,benchmark:M,metric:C}=e,z=void 0===M?null:M,q=(0,eu.f)(),R=(0,ec.useLocale)(),[B,P]=(0,eb.useState)(void 0===C?"cost":C),L=lc[B],A=null===z,H=function(e,{metric:l,benchmark:t}){let r=function(e,{metric:l,benchmark:t}){if(null===t)return[...Map.groupBy(e.flatMap(e=>lt(e,{metric:"score",usage:[],scorePortions:ln}).flatMap(({cell:e,value:t})=>{let r=e.run?G(e.run,l):null;return null===t||null===r||r<=0?[]:[{column:e.column,quality:t,price:r}]})),e=>e.column.key).entries()].flatMap(([e,l])=>{let[t]=l;return t?[{id:e,column:t.column,price:li(l.map(e=>e.price)),score:li(l.map(e=>e.quality)),benchmarkCount:l.length}]:[]});let r=e.find(e=>e.benchmark===t);return r?r.cells.flatMap(({run:e,key:t,column:r})=>{if(!e||!W(e))return[];let n=G(e,l);return null===n||n<=0?[]:[{id:t,price:n,score:100*e.accuracy,column:r,benchmarkCount:1}]}):[]}(e,{metric:l,benchmark:t}),n=(0,e4.f)(r.filter(e=>!F(e.column))),a=new Map;for(let e of r){if(F(e.column))continue;let l=ls(e.column),t=a.get(l);(!t||e.score>t.score)&&a.set(l,e)}return r.map(e=>{var l;let r;return{id:e.id,benchmark:t,benchmarkCount:e.benchmarkCount,seriesKey:e.column.key,label:null===(r=$(l=e.column))?eP(l):e$(eL(r),l),color:(0,e6.q)(e.column.key,e5.N),metricValue:e.price,scorePercent:e.score,isPareto:n.ids.has(e.id),isReference:F(e.column),chartLabel:a.get(ls(e.column))===e?function(e){if(e.family===k.f.Switchyard){let l=null!==e.routeModels&&e.routeModels.length>1?(function(e){let[l,...t]=e;if(void 0===l||0===t.length)return e;let r=[...l].findIndex((e,l)=>t.some(t=>t[l]!==e)),n=l.slice(0,-1===r?l.length:r),a=Math.max(n.lastIndexOf("-"),n.lastIndexOf(" "))+1,s=e.map(e=>e.slice(a));return 0===a||s.some(e=>""===e||/^\d/.test(e))?e:s})(e.routeModels.map(eL)).join(" + "):eB(e.model,e.routeModels);return e.provider===S?l:`${l} \xb7 ${e.provider}`}let l=eR(e.family,e.provider);if(!la.has(e.family)||null===e.costTier)return l;switch(e.costTier){case v.B.Low:return`${l} (Low)`;case v.B.Medium:return`${l} (Med)`;case v.B.High:return`${l} (High)`;default:return eP(e)}}(e.column):void 0}})}(T,{metric:B,benchmark:z}),I=function(e){if(0===e.length)return{min:0,max:10};let l=Math.min(...e),t=Math.max(...e),r=Math.max(.5,(t-l)*.1);return{min:Math.max(0,Math.floor(l-r)),max:Math.min(10,Math.ceil(t+r))}}(H.flatMap(lu)),V=A&&H.some(e=>e.scorePercent{let l=lr.find(l=>l===e);l&&P(l)},N[5]=a):a=N[5],N[6]!==q?(i=q("Chart metric"),N[6]=q,N[7]=i):i=N[7],N[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsx)(eG.SelectValue,{}),N[8]=c):c=N[8],N[9]!==i?(o=(0,l.jsx)(eG.SelectTrigger,{"aria-label":i,className:"w-40 max-w-full",children:c}),N[9]=i,N[10]=o):o=N[10],N[11]!==E?(u=lr.map(e=>(0,l.jsx)(eG.SelectItem,{value:e,children:E[e]},e)),N[11]=E,N[12]=u):u=N[12],N[13]!==u?(m=(0,l.jsx)(eG.SelectContent,{children:u}),N[13]=u,N[14]=m):m=N[14],N[15]!==B||N[16]!==m||N[17]!==o?(d=(0,l.jsxs)(eG.Select,{value:B,onValueChange:a,size:"compact",children:[o,m]}),N[15]=B,N[16]=m,N[17]=o,N[18]=d):d=N[18],N[19]!==B?(h=(0,l.jsx)(lf,{metric:B}),N[19]=B,N[20]=h):h=N[20],N[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsx)(s.T,{children:"No completed runs with this metric recorded."}),N[21]=f):f=N[21];let K=e0.Table;N[22]!==J?(x=(0,l.jsx)(e0.TableCaption,{children:J}),N[22]=J,N[23]=x):x=N[23],N[24]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.jsx)(e0.TableHead,{children:(0,l.jsx)(s.T,{children:"Model router"})}),N[24]=p):p=N[24],N[25]!==O?(b=(0,l.jsx)(e0.TableHead,{children:O}),N[25]=O,N[26]=b):b=N[26];let U=E[B];N[27]!==U?(g=(0,l.jsx)(e0.TableHead,{children:U}),N[27]=U,N[28]=g):g=N[28],N[29]!==b||N[30]!==g?(j=(0,l.jsx)(e0.TableHeader,{children:(0,l.jsxs)(e0.TableRow,{children:[p,b,g]})}),N[29]=b,N[30]=g,N[31]=j):j=N[31];let D=e0.TableBody;N[32]!==L||N[33]!==R?(y=e=>(0,l.jsxs)(e0.TableRow,{children:[(0,l.jsx)(e0.TableCell,{children:e.label}),(0,l.jsx)(e0.TableCell,{children:lh(R,e)}),(0,l.jsx)(e0.TableCell,{children:(0,ey.h)(R,L,e.metricValue)})]},e.id),N[32]=L,N[33]=R,N[34]=y):y=N[34];let Z=H.map(y);return N[35]!==D||N[36]!==Z?(_=(0,l.jsx)(D,{children:Z}),N[35]=D,N[36]=Z,N[37]=_):_=N[37],N[38]!==K||N[39]!==x||N[40]!==j||N[41]!==_?(w=(0,l.jsx)("div",{className:"sr-only",children:(0,l.jsxs)(K,{children:[x,j,_]})}),N[38]=K,N[39]=x,N[40]=j,N[41]=_,N[42]=w):w=N[42],(0,l.jsx)(e2.f,{kind:L,title:J,points:H,frontierSegments:Q,yScale:A?{...I,formatTick:e=>(0,ey.g)(R,e)}:void 0,headerControls:d,description:(0,l.jsx)(ld,{metric:B,isIndex:A,hasHiddenBaselines:V}),yAxisName:O,chartAriaLabel:J,tooltipContent:h,emptyText:f,accessibleFallback:w})}function lu(e){return e.isReference?[]:[e.scorePercent]}function lm(){let e,l,r,n,a=(0,t.c)(10),s=(0,eu.f)();return a[0]!==s?(e=s("Cost / task"),a[0]=s,a[1]=e):e=a[1],a[2]!==s?(l=s("Cost / success"),a[2]=s,a[3]=l):l=a[3],a[4]!==s?(r=s("Generation / task"),a[4]=s,a[5]=r):r=a[5],a[6]!==e||a[7]!==l||a[8]!==r?(n={cost:e,costPerSuccess:l,speed:r},a[6]=e,a[7]=l,a[8]=r,a[9]=n):n=a[9],n}function ld(e){let r,n,a,i,c,o=(0,t.c)(10),{metric:u,isIndex:m,hasHiddenBaselines:d}=e;o[0]===Symbol.for("react.memo_cache_sentinel")?(r={cost:(0,l.jsx)(s.T,{children:"Recorded cost per evaluated task, log scale."}),costPerSuccess:(0,l.jsx)(s.T,{children:"Recorded cost per correct answer, log scale."}),speed:(0,l.jsx)(s.T,{children:"Mean generation time per evaluated task."})},o[0]=r):r=o[0];let h=r[u];o[1]!==m?(n=m?(0,l.jsx)(s.T,{children:"Quality score is accuracy relative to the best router on each benchmark (0–10), averaged across benchmarks. A baseline that beats every router is capped at 10."}):(0,l.jsx)(s.T,{children:"Quality on the selected benchmark."}),o[1]=m,o[2]=n):n=o[2];let f=n;return o[3]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsx)(s.T,{children:"Hollow points are single model baselines, shown for reference."}),o[3]=a):a=o[3],o[4]!==d?(i=d&&(0,l.jsxs)(l.Fragment,{children:[" ",(0,l.jsx)(s.T,{children:"Baselines that score below the axis are left off; they are still in the results table."})]}),o[4]=d,o[5]=i):i=o[5],o[6]!==h||o[7]!==f||o[8]!==i?(c=(0,l.jsxs)(l.Fragment,{children:[h," ",f," ",a,i]}),o[6]=h,o[7]=f,o[8]=i,o[9]=c):c=o[9],c}function lh(e,l){return null===l.benchmark?(0,ey.g)(e,l.scorePercent):(0,ey.Z)(e,l.scorePercent/100)}function lf(e){let r,n,a,i,c,o,u,m,d,h,f=(0,t.c)(31),{active:x,payload:p,metric:b}=e,g=(0,ec.useLocale)(),j=lm(),y=p?.[0]?.payload;if(!x||!y)return null;let _=y.label;f[0]!==y.benchmark||f[1]!==y.benchmarkCount?(r=null===y.benchmark?(0,l.jsxs)(s.T,{children:["Average over ",(0,l.jsx)(eo.d,{children:y.benchmarkCount})," benchmarks"]}):ez(y.benchmark),f[0]=y.benchmark,f[1]=y.benchmarkCount,f[2]=r):r=f[2],f[3]!==y.benchmark?(n=null===y.benchmark?(0,l.jsx)(s.T,{children:"Quality score"}):(0,l.jsx)(s.T,{children:"Quality"}),f[3]=y.benchmark,f[4]=n):n=f[4],f[5]!==g||f[6]!==y?(a=lh(g,y),f[5]=g,f[6]=y,f[7]=a):a=f[7],f[8]!==n||f[9]!==a?(i=(0,l.jsx)(e1.S,{label:n,children:a}),f[8]=n,f[9]=a,f[10]=i):i=f[10];let w=j[b],k=lc[b];return f[11]!==g||f[12]!==y.metricValue||f[13]!==k?(c=(0,ey.h)(g,k,y.metricValue),f[11]=g,f[12]=y.metricValue,f[13]=k,f[14]=c):c=f[14],f[15]!==w||f[16]!==c?(o=(0,l.jsx)(e1.S,{label:w,children:c}),f[15]=w,f[16]=c,f[17]=o):o=f[17],f[18]!==i||f[19]!==o?(u=(0,l.jsxs)(e1.P,{children:[i,o]}),f[18]=i,f[19]=o,f[20]=u):u=f[20],f[21]!==y.isReference?(m=y.isReference&&(0,l.jsx)("p",{className:"mt-1",children:(0,l.jsx)(s.T,{children:"Single model baseline, not on the frontier"})}),f[21]=y.isReference,f[22]=m):m=f[22],f[23]!==y.isPareto?(d=y.isPareto&&(0,l.jsx)("p",{className:"mt-1",children:(0,l.jsx)(s.T,{children:"On the frontier"})}),f[23]=y.isPareto,f[24]=d):d=f[24],f[25]!==y.label||f[26]!==u||f[27]!==m||f[28]!==d||f[29]!==r?(h=(0,l.jsxs)(e1.J,{className:"min-w-44",label:_,children:[r,u,m,d]}),f[25]=y.label,f[26]=u,f[27]=m,f[28]=d,f[29]=r,f[30]=h):h=f[30],h}var lx=e.i(702441),lp=e.i(894868),lb=e.i(967605),lg=e.i(408253);function lj(e){return"quality"===e||"cache"===e||"score"===e?"desc":"asc"}function ly(e,l){let[t,r]=e;return null===t?+(null!==r):null===r?-1:"asc"===l?t-r:r-t}var l_=e.i(339814);let lw=["quality","cost","costPerSuccess","speed"];var lk=e.i(354896);function lv(e){let r,n,a,s,i,c,o=(0,t.c)(21),{label:u,children:m,layer:d,columnCount:h,family:f,isShaded:x,isExpanded:p,onToggle:b}=e,g=void 0===p||p,j=(void 0===x||x)&&"bg-muted/30";return o[0]!==j?(r=(0,eA.f)(j,"max-md:block"),o[0]=j,o[1]=r):r=o[1],o[2]!==m||o[3]!==g||o[4]!==u||o[5]!==b?(n=b?(0,l.jsx)(lS,{label:u,isExpanded:g,onToggle:b,children:m}):m,o[2]=m,o[3]=g,o[4]=u,o[5]=b,o[6]=n):n=o[6],o[7]!==h||o[8]!==n?(a=(0,l.jsx)(e0.TableRowHead,{colSpan:h,children:n}),o[7]=h,o[8]=n,o[9]=a):a=o[9],o[10]!==f||o[11]!==r||o[12]!==a?(s=(0,l.jsx)(e0.TableRow,{className:r,"data-family":f,children:a}),o[10]=f,o[11]=r,o[12]=a,o[13]=s):s=o[13],o[14]!==h||o[15]!==g||o[16]!==d?(i=g&&d&&(0,l.jsx)(e0.TableRow,{className:"max-md:block",children:(0,l.jsx)(e0.TableRowHead,{colSpan:h,children:(0,l.jsx)("span",{className:"block pl-8 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",children:d})})}),o[14]=h,o[15]=g,o[16]=d,o[17]=i):i=o[17],o[18]!==s||o[19]!==i?(c=(0,l.jsxs)(l.Fragment,{children:[s,i]}),o[18]=s,o[19]=i,o[20]=c):c=o[20],c}function lS(e){let n,a,s,i,c=(0,t.c)(12),{label:o,children:u,isExpanded:m,onToggle:d}=e,h=!m&&"-rotate-90";return c[0]!==h?(n=(0,eA.f)(h),c[0]=h,c[1]=n):n=c[1],c[2]!==n?(a=(0,l.jsx)(lk.f,{"aria-hidden":"true",className:n}),c[2]=n,c[3]=a):a=c[3],c[4]!==m||c[5]!==o||c[6]!==d||c[7]!==a?(s=(0,l.jsx)(r.Button,{variant:"ghost",tone:"subdued",size:"icon-sm","aria-label":o,"aria-expanded":m,onClick:d,className:"shrink-0",children:a}),c[4]=m,c[5]=o,c[6]=d,c[7]=a,c[8]=s):s=c[8],c[9]!==u||c[10]!==s?(i=(0,l.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[s,u]}),c[9]=u,c[10]=s,c[11]=i):i=c[11],i}function lN(e){let r,n,a,i,c,o,u,m,d,h,f,x,p,b,g,j=(0,t.c)(38),{rows:y}=e,_=(0,ec.useLocale)(),w=(0,eu.f)(),[k,v]=(0,eb.useState)(null);j[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,j[0]=r):r=j[0];let[S,N]=(0,eb.useState)(r);j[1]!==_||j[2]!==y||j[3]!==k?(n=function(e,{sort:l,locale:t}){let r=e.flatMap(e=>e.cells.flatMap(({key:l,run:t})=>t?[{key:l,run:t,benchmark:e.benchmark}]:[]).toSorted((e,l)=>ly([G(e.run,"quality"),G(l.run,"quality")],"desc")));if(!l)return r;let n=lw.find(e=>e===l.key);if(n)return r.toSorted((e,t)=>ly([G(e.run,n),G(t.run,n)],l.direction));if("benchmark"!==l.key&&"router"!==l.key)return r;let a=e=>"benchmark"===l.key?ez(e.benchmark):eq(e.run);return r.toSorted((e,r)=>(0,l_.o)(a(e),a(r),{locale:t,comparison:"base"})*("asc"===l.direction?1:-1))}(y,{sort:k,locale:_}),j[1]=_,j[2]=y,j[3]=k,j[4]=n):n=j[4];let T=n;j[5]!==w?(a=w("Quality"),j[5]=w,j[6]=a):a=j[6],j[7]!==w?(i=w("Cost / task"),j[7]=w,j[8]=i):i=j[8],j[9]!==w?(c=w("Cost / success"),j[9]=w,j[10]=c):c=j[10],j[11]!==w?(o=w("Time / task"),j[11]=w,j[12]=o):o=j[12],j[13]!==a||j[14]!==i||j[15]!==c||j[16]!==o?(u={quality:a,cost:i,costPerSuccess:c,speed:o},j[13]=a,j[14]=i,j[15]=c,j[16]=o,j[17]=u):u=j[17];let M=u;if(j[18]!==w?(m=w("Model routing results"),j[18]=w,j[19]=m):m=j[19],j[20]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(e0.TableHead,{sortKey:"benchmark",className:(0,eA.f)("md:w-1/5",lg.default.sortHeader),children:(0,l.jsx)(s.T,{children:"Benchmark"})}),j[20]=d):d=j[20],j[21]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)(e0.TableHead,{sortKey:"router",className:(0,eA.f)("md:w-1/4",lg.default.sortHeader),children:(0,l.jsx)(s.T,{children:"Model router"})}),j[21]=h):h=j[21],j[22]!==M?(f=lw.map(e=>(0,l.jsx)(e0.TableHead,{sortKey:e,sortFirstDirection:"asc"===lj(e)?"ascending":"descending",className:(0,eA.f)("or-table__cell--wrap-words text-center text-xs",lg.default.sortHeader),children:M[e]},e)),j[22]=M,j[23]=f):f=j[23],j[24]!==f?(x=(0,l.jsx)(e0.TableHeader,{className:"max-md:block",children:(0,l.jsxs)(e0.TableRow,{className:"max-md:flex max-md:flex-wrap",children:[d,h,f]})}),j[24]=f,j[25]=x):x=j[25],j[26]!==T||j[27]!==S||j[28]!==w||j[29]!==k)p=k?T.map(lM):[...new Set(T.map(e=>e.benchmark))].map(e=>({benchmark:e,cells:T.filter(l=>l.benchmark===e)})).map(e=>{let{benchmark:t,cells:r}=e,n=!S.has(t);return(0,l.jsxs)(eb.Fragment,{children:[(0,l.jsx)(lv,{label:w("{benchmark} results",{benchmark:ez(t)}),isExpanded:n,onToggle:()=>N(e=>{var l,r;let n;return l=e,r=t,(n=new Set(l)).delete(r)||n.add(r),n}),columnCount:lw.length+2,children:(0,l.jsxs)("span",{className:"flex min-w-0 items-baseline gap-2 text-xs font-medium",children:[ez(t),(0,l.jsx)("span",{className:"font-normal text-muted-foreground",children:w("{count, plural, one {# result} other {# results}}",{count:r.length})})]})}),n&&r.map(lT)]},t)}),j[26]=T,j[27]=S,j[28]=w,j[29]=k,j[30]=p;else p=j[30];return j[31]!==p?(b=(0,l.jsx)(e0.TableBody,{className:"max-md:block",children:p}),j[31]=p,j[32]=b):b=j[32],j[33]!==k||j[34]!==x||j[35]!==b||j[36]!==m?(g=(0,l.jsx)(lx.N,{children:(0,l.jsxs)(e0.Table,{"aria-label":m,compact:!0,sort:k,onSortChange:v,className:"max-md:block md:table-fixed max-md:[&_td]:text-left max-md:[&_td[data-label]]:before:block max-md:[&_td[data-label]]:before:text-xs max-md:[&_td[data-label]]:before:font-normal max-md:[&_td[data-label]]:before:text-muted-foreground max-md:[&_td[data-label]]:before:content-[attr(data-label)]",children:[x,b]})}),j[33]=k,j[34]=x,j[35]=b,j[36]=m,j[37]=g):g=j[37],g}function lT(e){return(0,l.jsx)(lC,{cell:e,isGrouped:!0},e.key)}function lM(e){return(0,l.jsx)(lC,{cell:e},e.key)}function lC(e){let r,n,a,i,c,o,u,m,d,h,f,x,p,b,g,j,y,_,w,k,v,S,N,T,M,C=(0,t.c)(74),{cell:z,isGrouped:q}=e,{run:R,benchmark:B}=z,P=void 0!==q&&q,F=(0,ec.useLocale)(),L=(0,eu.f)();C[0]!==R.model_permaslug||C[1]!==R.route_models?(r=$({model:R.model_permaslug,routeModels:R.route_models})??R.model_permaslug,C[0]=R.model_permaslug,C[1]=R.route_models,C[2]=r):r=C[2];let A=r;C[3]!==B||C[4]!==L||C[5]!==P?(n=!P&&(0,l.jsx)(e0.TableCell,{"data-label":L("Benchmark"),className:"or-table__cell--wrap-words max-md:col-span-2",children:ez(B)}),C[3]=B,C[4]=L,C[5]=P,C[6]=n):n=C[6];let H=P?2:void 0;C[7]===Symbol.for("react.memo_cache_sentinel")?(a=(0,eA.f)("or-table__cell--wrap-words max-md:col-span-2"),C[7]=a):a=C[7],C[8]!==B||C[9]!==P?(i=P&&(0,l.jsxs)("span",{className:"sr-only",children:[ez(B)," "]}),C[8]=B,C[9]=P,C[10]=i):i=C[10];let I=R.model_permaslug;return C[11]!==A?(c=(0,ew.x)(A),C[11]=A,C[12]=c):c=C[12],C[13]!==A||C[14]!==c?(o=(0,l.jsx)("span",{"aria-hidden":"true",className:"flex shrink-0",children:(0,l.jsx)(lp.f,{author:c,permaslug:A,className:"size-4",frame:!0})}),C[13]=A,C[14]=c,C[15]=o):o=C[15],C[16]!==A?(u=eF(A),C[16]=A,C[17]=u):u=C[17],C[18]!==R?(m=eq(R),C[18]=R,C[19]=m):m=C[19],C[20]!==u||C[21]!==m?(d=(0,l.jsx)(lb.Link,{href:u,className:"min-w-0 hover:underline focus-visible:underline",children:m}),C[20]=u,C[21]=m,C[22]=d):d=C[22],C[23]!==R.model_permaslug||C[24]!==o||C[25]!==d?(h=(0,l.jsxs)("span",{className:"inline-flex max-w-full items-center gap-2 text-left font-medium",title:I,children:[o,d]}),C[23]=R.model_permaslug,C[24]=o,C[25]=d,C[26]=h):h=C[26],C[27]!==R.success?(f=!R.success&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:(0,l.jsx)(s.T,{children:"Failed"})}),C[27]=R.success,C[28]=f):f=C[28],C[29]!==h||C[30]!==f||C[31]!==H||C[32]!==i?(x=(0,l.jsxs)(e0.TableCell,{colSpan:H,className:a,children:[i,h,f]}),C[29]=h,C[30]=f,C[31]=H,C[32]=i,C[33]=x):x=C[33],C[34]!==L?(p=L("Quality"),C[34]=L,C[35]=p):p=C[35],C[36]!==F||C[37]!==R.accuracy||C[38]!==R.total_questions?(b=R.total_questions>0?(0,ey.Z)(F,R.accuracy):"—",C[36]=F,C[37]=R.accuracy,C[38]=R.total_questions,C[39]=b):b=C[39],C[40]!==p||C[41]!==b?(g=(0,l.jsx)(e0.TableCell,{strong:!0,"data-label":p,className:"text-center tabular-nums",children:b}),C[40]=p,C[41]=b,C[42]=g):g=C[42],C[43]!==L?(j=L("Cost / task"),C[43]=L,C[44]=j):j=C[44],C[45]!==F||C[46]!==R?(y=(0,ey.J)(F,G(R,"cost")),C[45]=F,C[46]=R,C[47]=y):y=C[47],C[48]!==j||C[49]!==y?(_=(0,l.jsx)(e0.TableCell,{"data-label":j,className:"text-center tabular-nums",children:y}),C[48]=j,C[49]=y,C[50]=_):_=C[50],C[51]!==L?(w=L("Cost / success"),C[51]=L,C[52]=w):w=C[52],C[53]!==F||C[54]!==R?(k=(0,ey.J)(F,G(R,"costPerSuccess")),C[53]=F,C[54]=R,C[55]=k):k=C[55],C[56]!==w||C[57]!==k?(v=(0,l.jsx)(e0.TableCell,{"data-label":w,className:"text-center tabular-nums",children:k}),C[56]=w,C[57]=k,C[58]=v):v=C[58],C[59]!==L?(S=L("Time / task"),C[59]=L,C[60]=S):S=C[60],C[61]!==F||C[62]!==R?(N=(0,ey.E)(F,G(R,"speed")),C[61]=F,C[62]=R,C[63]=N):N=C[63],C[64]!==S||C[65]!==N?(T=(0,l.jsx)(e0.TableCell,{"data-label":S,className:"text-center tabular-nums",children:N}),C[64]=S,C[65]=N,C[66]=T):T=C[66],C[67]!==x||C[68]!==g||C[69]!==_||C[70]!==v||C[71]!==T||C[72]!==n?(M=(0,l.jsxs)(e0.TableRow,{className:"max-md:grid max-md:grid-cols-2 max-md:py-2",children:[n,x,g,_,v,T]}),C[67]=x,C[68]=g,C[69]=_,C[70]=v,C[71]=T,C[72]=n,C[73]=M):M=C[73],M}function lz(e){let r,n,a,i,c,o,u,m,d,h=(0,t.c)(20),{allRows:f,benchmark:x,onBenchmarkChange:p}=e,b=(0,eu.f)();h[0]!==f||h[1]!==x?(n=(r=eE(f)).some(e=>e.benchmark===x)?x:null,h[0]=f,h[1]=x,h[2]=r,h[3]=n):(r=h[2],n=h[3]);let g=n;return h[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,eA.f)("flex flex-col gap-6",eH.w),h[4]=a):a=h[4],h[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)("h2",{children:(0,l.jsx)(s.T,{children:"Model Routing Frontier"})}),h[5]=i):i=h[5],h[6]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsxs)("div",{className:"flex max-w-2xl flex-col gap-1",children:[i,(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:(0,l.jsx)(s.T,{children:"By default each point is a model router’s quality averaged across benchmarks. Cost and speed stay on the horizontal axis instead of being folded into quality, unlike the Model Routing Index in the matrix. Pick a benchmark to compare quality on it, or change what the horizontal axis measures."})})]}),h[6]=c):c=h[6],h[7]!==b?(o=b("Benchmark"),h[7]=b,h[8]=o):o=h[8],h[9]!==g||h[10]!==p||h[11]!==r||h[12]!==o?(u=(0,l.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[c,(0,l.jsx)(eX,{benchmark:g,rows:r,onSelect:p,ariaLabel:o,className:"w-64 max-w-full"})]}),h[9]=g,h[10]=p,h[11]=r,h[12]=o,h[13]=u):u=h[13],h[14]!==g||h[15]!==r?(m=(0,l.jsx)(lo,{rows:r,benchmark:g}),h[14]=g,h[15]=r,h[16]=m):m=h[16],h[17]!==u||h[18]!==m?(d=(0,l.jsxs)("section",{id:"efficiency",className:a,children:[u,m]}),h[17]=u,h[18]=m,h[19]=d):d=h[19],d}function lq(e){let r,n,a,i=(0,t.c)(4),{rows:c}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,eA.f)("flex flex-col gap-6",eH.w),n=(0,l.jsx)("div",{children:(0,l.jsx)("h2",{children:(0,l.jsx)(s.T,{children:"Model routing results"})})}),i[0]=r,i[1]=n):(r=i[0],n=i[1]),i[2]!==c?(a=(0,l.jsxs)("section",{id:"results",className:r,children:[n,(0,l.jsx)(lN,{rows:c})]}),i[2]=c,i[3]=a):a=i[3],a}var lR=e.i(771743),lB=e.i(954217),lP=e.i(751155),l$=e.i(862389),lF=e.i(150080);function lL(e){let n,a,i,c,o,u,m,d,h,f,x=(0,t.c)(25),{benchmarks:p,metric:b,sort:g,onSortChange:j}=e,y=(0,eu.f)(),_=g?.key??"";return x[0]!==b||x[1]!==j?(n=e=>j(e?{key:e,direction:lj(b)}:null),x[0]=b,x[1]=j,x[2]=n):n=x[2],x[3]!==y?(a=y("Sort matrix by benchmark"),x[3]=y,x[4]=a):a=x[4],x[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)(eG.SelectValue,{}),x[5]=i):i=x[5],x[6]!==a?(c=(0,l.jsx)(eG.SelectTrigger,{"aria-label":a,className:"min-w-0 flex-1",children:i}),x[6]=a,x[7]=c):c=x[7],x[8]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsx)(eG.SelectItem,{value:"",children:(0,l.jsx)(s.T,{children:"Default order"})}),x[8]=o):o=x[8],x[9]!==p?(u=p.map(lA),x[9]=p,x[10]=u):u=x[10],x[11]!==u?(m=(0,l.jsxs)(eG.SelectContent,{children:[o,u]}),x[11]=u,x[12]=m):m=x[12],x[13]!==_||x[14]!==n||x[15]!==c||x[16]!==m?(d=(0,l.jsxs)(eG.Select,{size:"compact",value:_,onValueChange:n,children:[c,m]}),x[13]=_,x[14]=n,x[15]=c,x[16]=m,x[17]=d):d=x[17],x[18]!==b||x[19]!==j||x[20]!==g?(h=g&&(0,l.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>j({...g,direction:"asc"===g.direction?"desc":"asc"}),children:g.direction===lj(b)?(0,l.jsx)(s.T,{children:"Best first"}):(0,l.jsx)(s.T,{children:"Worst first"})}),x[18]=b,x[19]=j,x[20]=g,x[21]=h):h=x[21],x[22]!==h||x[23]!==d?(f=(0,l.jsxs)("div",{className:"flex items-center gap-2 md:hidden",children:[d,h]}),x[22]=h,x[23]=d,x[24]=f):f=x[24],f}function lA(e){return(0,l.jsx)(eG.SelectItem,{value:e,children:ez(e)},e)}let lH="md:border-l md:border-border",lI="truncate hover:underline focus-visible:underline";function lV(e){let r,n,a,i,c,o,u,m,d,h,f,x,p,b,g,j,y,_,w=(0,t.c)(63),{matrix:v,metric:S,usage:N,scorePortions:T}=e,M=(0,eu.f)(),[C,z]=(0,eb.useState)(null);if(w[0]!==v){var q;let e,l;l=new Set((e=(q={...v,rows:eE(v.rows)}).rows.toSorted((e,l)=>eJ(e)-eJ(l)||eQ(l)-eQ(e)||eW(e.benchmark,l.benchmark))).flatMap(e=>e.cells.flatMap(({run:e,column:l})=>e?[l.key]:[]))),r={rows:e,groups:q.groups.map(e=>({...e,columns:e.columns.filter(e=>l.has(e.key)).toSorted(eK)})).filter(e=>e.columns.length>0).toSorted((e,l)=>Number(eU(e))-Number(eU(l))||eD(eR(e.family,e.provider),eR(l.family,l.provider)))},w[0]=v,w[1]=r}else r=w[1];let{rows:R,groups:B}=r;if(w[2]!==S||w[3]!==R||w[4]!==T||w[5]!==N){let e;w[7]!==S||w[8]!==T||w[9]!==N?(e=e=>{let l=lt(e,{metric:S,usage:N,scorePortions:T}),t="score"===S?l:lt(e,{metric:"score",usage:N,scorePortions:T});return{benchmark:e.benchmark,byColumn:new Map(l.map(lJ)),indexByColumn:new Map(t.map(lE))}},w[7]=S,w[8]=T,w[9]=N,w[10]=e):e=w[10],n=R.map(e),w[2]=S,w[3]=R,w[4]=T,w[5]=N,w[6]=n}else n=w[6];let P=n;if(w[11]!==P||w[12]!==B||w[13]!==M||w[14]!==S||w[15]!==C){let e,t,r,n=function({groups:e,benchmarks:l,sort:t}){let r=l.find(e=>e.benchmark===t?.key)?.byColumn,n=e=>{let l=e&&r?.get(e.key);return l?.cell.run&&W(l.cell.run)&&Number.isFinite(l.value)?l.value:null};return t&&r?e.flatMap(e=>e.columns.map(l=>({...e,key:l.key,columns:[l],winner:l}))).toSorted((e,l)=>ly([n(e.winner),n(l.winner)],t.direction)):e.map(e=>{var t;let r=e.family!==k.f.Switchyard&&L(e)?e.columns.toSorted((e,l)=>A(e.costTier,l.costTier)):e.columns;return{...e,winner:(t=l.map(e=>e.indexByColumn),r.flatMap(e=>{let l=t.flatMap(l=>{let t=l.get(e.key)?.value;return null!=t&&Number.isFinite(t)?[t]:[]});return 0===l.length?[]:[{column:e,score:l.reduce((e,l)=>e+l,0)/l.length,benchmarkCount:l.length}]}).toSorted((e,l)=>l.score-e.score||l.benchmarkCount-e.benchmarkCount||A(e.column.costTier,l.column.costTier))[0]?.column),columns:r}})}({groups:B,benchmarks:P,sort:C});if(w[28]!==P?(e=P.map(lO),w[28]=P,w[29]=e):e=w[29],w[30]!==S||w[31]!==C||w[32]!==e?(u=(0,l.jsx)(lL,{benchmarks:e,metric:S,sort:C,onSortChange:z}),w[30]=S,w[31]=C,w[32]=e,w[33]=u):u=w[33],c=lx.N,i=e0.Table,w[34]!==M?(h=M("Model routing benchmark comparison"),w[34]=M,w[35]=h):h=w[35],f="max-md:block",x=!0,p=C,b=z,w[36]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)(e0.TableHead,{children:(0,l.jsx)(s.T,{children:"Model router"})}),w[36]=t):t=w[36],w[37]!==P||w[38]!==S){let e;w[40]!==S?(e=e=>{let{benchmark:t}=e;return(0,l.jsx)(e0.TableHead,{sortKey:t,sortFirstDirection:"asc"===lj(S)?"ascending":"descending",className:(0,eA.f)("or-table__cell--wrap-words text-right text-[11px] md:w-28",lH,lg.default.sortHeader),children:(0,l.jsx)("span",{className:"inline-block max-w-20 text-balance",children:ez(t)})},t)},w[40]=S,w[41]=e):e=w[41],r=P.map(e),w[37]=P,w[38]=S,w[39]=r}else r=w[39];w[42]!==r?(o=(0,l.jsx)(e0.TableHeader,{className:"max-md:sr-only",children:(0,l.jsxs)(e0.TableRow,{children:[t,r]})}),w[42]=r,w[43]=o):o=w[43],a=e0.TableBody,m="max-md:block",d=null===C?(0,l.jsx)(lQ,{groups:n,benchmarks:P,metric:S}):n.map(e=>(0,l.jsx)(lD,{group:e,isSorted:!0,benchmarks:P,metric:S},e.key)),w[11]=P,w[12]=B,w[13]=M,w[14]=S,w[15]=C,w[16]=a,w[17]=i,w[18]=c,w[19]=o,w[20]=u,w[21]=m,w[22]=d,w[23]=h,w[24]=f,w[25]=x,w[26]=p,w[27]=b}else a=w[16],i=w[17],c=w[18],o=w[19],u=w[20],m=w[21],d=w[22],h=w[23],f=w[24],x=w[25],p=w[26],b=w[27];return w[44]!==a||w[45]!==m||w[46]!==d?(g=(0,l.jsx)(a,{className:m,children:d}),w[44]=a,w[45]=m,w[46]=d,w[47]=g):g=w[47],w[48]!==i||w[49]!==o||w[50]!==g||w[51]!==h||w[52]!==f||w[53]!==x||w[54]!==p||w[55]!==b?(j=(0,l.jsxs)(i,{"aria-label":h,className:f,compact:x,sort:p,onSortChange:b,children:[o,g]}),w[48]=i,w[49]=o,w[50]=g,w[51]=h,w[52]=f,w[53]=x,w[54]=p,w[55]=b,w[56]=j):j=w[56],w[57]!==c||w[58]!==j?(y=(0,l.jsx)(c,{children:j}),w[57]=c,w[58]=j,w[59]=y):y=w[59],w[60]!==u||w[61]!==y?(_=(0,l.jsxs)(l.Fragment,{children:[u,y]}),w[60]=u,w[61]=y,w[62]=_):_=w[62],_}function lO(e){let{benchmark:l}=e;return l}function lE(e){return[e.cell.column.key,e]}function lJ(e){return[e.cell.column.key,e]}function lQ(e){let r,n,a,i,c=(0,t.c)(15),{groups:o,benchmarks:u,metric:m}=e,d=(0,eu.f)(),[h,f]=(0,eb.useState)(!0);if(c[0]!==u||c[1]!==o||c[2]!==d||c[3]!==h||c[4]!==m){let e,t=o.filter(lU),i=o.filter(l8);c[8]!==u||c[9]!==m?(e=e=>(0,l.jsx)(lD,{group:e,isSorted:!1,benchmarks:u,metric:m},e.key),c[8]=u,c[9]=m,c[10]=e):e=c[10];let x=e;r=t.length>0&&(0,l.jsx)(lv,{label:d("Routers"),columnCount:u.length+1,isExpanded:h,onToggle:()=>f(lK),children:(0,l.jsx)("span",{className:"text-sm font-medium",children:(0,l.jsx)(s.T,{children:"Routers"})})}),n=h&&t.map(x),a=i.map(x),c[0]=u,c[1]=o,c[2]=d,c[3]=h,c[4]=m,c[5]=r,c[6]=n,c[7]=a}else r=c[5],n=c[6],a=c[7];return c[11]!==r||c[12]!==n||c[13]!==a?(i=(0,l.jsxs)(l.Fragment,{children:[r,n,a]}),c[11]=r,c[12]=n,c[13]=a,c[14]=i):i=c[14],i}function lK(e){return!e}function lU(e){return!l8(e)}function lD(e){let r,n,a,s,i,c=(0,t.c)(13);if(c[0]!==e?({group:r,isSorted:n,...a}=e,c[0]=e,c[1]=r,c[2]=n,c[3]=a):(r=c[1],n=c[2],a=c[3]),!n&&l8(r)){let t;return c[4]!==e?(t=(0,l.jsx)(lW,{...e}),c[4]=e,c[5]=t):t=c[5],t}if(!n&&L(r)){let t;return c[6]!==e?(t=(0,l.jsx)(l0,{...e}),c[6]=e,c[7]=t):t=c[7],t}return c[8]!==r||c[9]!==a?(s=r.columns.map(e=>(0,l.jsx)(l1,{column:e,label:(0,l.jsx)(l6,{group:r,column:e}),...a},e.key)),c[8]=r,c[9]=a,c[10]=s):s=c[10],c[11]!==s?(i=(0,l.jsx)(l.Fragment,{children:s}),c[11]=s,c[12]=i):i=c[12],i}function lW(e){let r,n,a,i,c,o=(0,t.c)(22),{group:u,benchmarks:m,metric:d}=e,h=(0,eu.f)(),[f,x]=(0,eb.useState)(!0),[p,b]=(0,eb.useState)(!0);if(o[0]!==m||o[1]!==u||o[2]!==h||o[3]!==p||o[4]!==f||o[5]!==d){let e=u.columns.flatMap(lY);if(o[10]!==m||o[11]!==u||o[12]!==h||o[13]!==f||o[14]!==d){let e=u.columns.filter(lX),t=u.provider===S?"":` \xb7 ${u.provider}`;r=e.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(lv,{label:`${h("Multi Model Switching")}${t}`,columnCount:m.length+1,isExpanded:f,onToggle:()=>x(lZ),children:(0,l.jsxs)("span",{className:"text-sm font-medium",children:[(0,l.jsx)(s.T,{children:"Multi Model Switching"}),t]})}),f&&(0,l.jsx)(lv,{label:eR(u.family,u.provider),family:u.family,isShaded:!1,layer:(0,l.jsx)(s.T,{children:"Algorithm: Stage"}),columnCount:m.length+1,children:(0,l.jsx)(l7,{group:u})})]}),n=f&&e.map(e=>(0,l.jsx)(l1,{column:e,label:(0,l.jsx)(l3,{column:e}),benchmarks:m,metric:d,compact:!0},e.key)),o[10]=m,o[11]=u,o[12]=h,o[13]=f,o[14]=d,o[15]=r,o[16]=n}else r=o[15],n=o[16];a=e.length>0&&(0,l.jsx)(lv,{label:h("Single Model Baselines (Reference)"),columnCount:m.length+1,isExpanded:p,onToggle:()=>b(lG),children:(0,l.jsx)("span",{className:"text-sm font-medium",children:(0,l.jsx)(s.T,{children:"Single Model Baselines (Reference)"})})}),i=p&&e.map(e=>{let{column:t,model:r}=e;return(0,l.jsx)(l1,{column:t,label:(0,l.jsx)(l5,{column:t,model:r}),benchmarks:m,metric:d,compact:!0},t.key)}),o[0]=m,o[1]=u,o[2]=h,o[3]=p,o[4]=f,o[5]=d,o[6]=r,o[7]=n,o[8]=a,o[9]=i}else r=o[6],n=o[7],a=o[8],i=o[9];return o[17]!==r||o[18]!==n||o[19]!==a||o[20]!==i?(c=(0,l.jsxs)(l.Fragment,{children:[r,n,a,i]}),o[17]=r,o[18]=n,o[19]=a,o[20]=i,o[21]=c):c=o[21],c}function lG(e){return!e}function lZ(e){return!e}function lX(e){return null===$(e)}function lY(e){let l=$(e);return null===l?[]:[{column:e,model:l}]}function l0(e){let r,n,a,i,c,o,u=(0,t.c)(21),{group:m,benchmarks:d,metric:h}=e,f=m.columns;u[0]!==m.family||u[1]!==m.provider?(r=eR(m.family,m.provider),u[0]=m.family,u[1]=m.provider,u[2]=r):r=u[2],u[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,l.jsx)(s.T,{children:"Cost Tier"}),u[3]=n):n=u[3];let x=d.length+1;if(u[4]!==m?(a=(0,l.jsx)(l7,{group:m}),u[4]=m,u[5]=a):a=u[5],u[6]!==m.family||u[7]!==r||u[8]!==x||u[9]!==a?(i=(0,l.jsx)(lv,{label:r,family:m.family,isShaded:!1,layer:n,columnCount:x,children:a}),u[6]=m.family,u[7]=r,u[8]=x,u[9]=a,u[10]=i):i=u[10],u[11]!==d||u[12]!==h||u[13]!==f){let e;u[15]!==d||u[16]!==h?(e=e=>(0,l.jsx)(l1,{column:e,label:(0,l.jsx)("span",{className:"block min-w-0 truncate pl-12 text-xs font-normal text-muted-foreground capitalize",title:e.model,children:e.costTier}),benchmarks:d,metric:h,compact:!0},e.key),u[15]=d,u[16]=h,u[17]=e):e=u[17],c=f.map(e),u[11]=d,u[12]=h,u[13]=f,u[14]=c}else c=u[14];return u[18]!==i||u[19]!==c?(o=(0,l.jsxs)(l.Fragment,{children:[i,c]}),u[18]=i,u[19]=c,u[20]=o):o=u[20],o}function l1(e){let r,n,a,s,i=(0,t.c)(16),{column:c,label:o,benchmarks:u,metric:m,compact:d}=e,h=void 0!==d&&d,f=c.key;if(i[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,eA.f)("whitespace-nowrap max-md:col-span-2"),i[0]=r):r=i[0],i[1]!==o?(n=(0,l.jsx)(e0.TableRowHead,{className:r,children:o}),i[1]=o,i[2]=n):n=i[2],i[3]!==u||i[4]!==c.key||i[5]!==h||i[6]!==m){let e;i[8]!==c.key||i[9]!==h||i[10]!==m?(e=e=>{let{benchmark:t,byColumn:r}=e,n=r.get(c.key);return(0,l.jsx)(l2,{benchmark:t,cell:n,metric:m,compact:h},t)},i[8]=c.key,i[9]=h,i[10]=m,i[11]=e):e=i[11],a=u.map(e),i[3]=u,i[4]=c.key,i[5]=h,i[6]=m,i[7]=a}else a=i[7];return i[12]!==c.key||i[13]!==n||i[14]!==a?(s=(0,l.jsxs)(e0.TableRow,{className:"max-md:grid max-md:grid-cols-2 max-md:py-2","data-router":f,children:[n,a]}),i[12]=c.key,i[13]=n,i[14]=a,i[15]=s):s=i[15],s}function l2(e){let r,n,a,s,i,c,o,u,m=(0,t.c)(21),{benchmark:d,cell:h,metric:f,compact:x}=e,p=h?.heat??null,b=null!==p&&lg.default.heat;m[0]!==b?(r=(0,eA.f)("text-right max-md:min-w-0 max-md:text-left",lH,b),m[0]=b,m[1]=r):r=m[1],m[2]!==p?(n=null===p?void 0:{"--heat-ratio":p},m[2]=p,m[3]=n):n=m[3];let g=x?"py-0":"py-0.5";return m[4]!==g?(a=(0,eA.f)("inline-flex min-w-0 flex-col items-start md:min-w-12 md:items-end",g),m[4]=g,m[5]=a):a=m[5],m[6]!==d?(s=ez(d),m[6]=d,m[7]=s):s=m[7],m[8]!==s?(i=(0,l.jsx)("span",{className:"text-xs text-muted-foreground md:hidden",children:s}),m[8]=s,m[9]=i):i=m[9],m[10]!==h||m[11]!==f?(c=h?.cell.run?(0,l.jsx)(l9,{metric:f,value:h.value,isBest:h.isBest}):(0,l.jsx)("span",{className:"text-muted-foreground",children:"—"}),m[10]=h,m[11]=f,m[12]=c):c=m[12],m[13]!==a||m[14]!==i||m[15]!==c?(o=(0,l.jsxs)("div",{className:a,children:[i,c]}),m[13]=a,m[14]=i,m[15]=c,m[16]=o):o=m[16],m[17]!==r||m[18]!==n||m[19]!==o?(u=(0,l.jsx)(e0.TableCell,{className:r,"data-allow-inline-style":!0,style:n,children:o}),m[17]=r,m[18]=n,m[19]=o,m[20]=u):u=m[20],u}function l3(e){let r,n,a,s,i,c,o=(0,t.c)(14),{column:u}=e;if(o[0]!==u.model||o[1]!==u.routeModels){let e=H(u.model,u.routeModels);r="flex min-w-0 items-center gap-1.5 pl-12 text-xs font-normal text-muted-foreground",n=u.model,a=e.length>0&&(0,l.jsxs)("span",{"aria-hidden":"true",className:"flex shrink-0 items-center gap-1",children:[e.slice(0,4).map(l4),e.length>4&&(0,l.jsxs)("span",{className:"text-micro tabular-nums",children:["+",e.length-4]})]}),o[0]=u.model,o[1]=u.routeModels,o[2]=r,o[3]=n,o[4]=a}else r=o[2],n=o[3],a=o[4];return o[5]!==u?(s=e$(eB(u.model,u.routeModels),u),o[5]=u,o[6]=s):s=o[6],o[7]!==s?(i=(0,l.jsx)(lb.Link,{href:"/docs/guides/routing/routers/switchyard-router",className:lI,children:s}),o[7]=s,o[8]=i):i=o[8],o[9]!==r||o[10]!==n||o[11]!==a||o[12]!==i?(c=(0,l.jsxs)("span",{className:r,title:n,children:[a,i]}),o[9]=r,o[10]=n,o[11]=a,o[12]=i,o[13]=c):c=o[13],c}function l4(e){return(0,l.jsx)(lp.f,{author:(0,ew.x)(e),permaslug:e,className:"size-3",frame:!0},e)}function l5(e){let r,n,a,s,i,c,o,u=(0,t.c)(20),{column:m,model:d,isFlat:h}=e,f=!(void 0!==h&&h)&&"pl-8";u[0]!==f?(r=(0,eA.f)("flex min-w-0 items-center gap-2 text-xs font-normal text-muted-foreground",f),u[0]=f,u[1]=r):r=u[1];let x=m.model;return u[2]!==d?(n=(0,ew.x)(d),u[2]=d,u[3]=n):n=u[3],u[4]!==d||u[5]!==n?(a=(0,l.jsx)("span",{"aria-hidden":"true",className:"flex shrink-0",children:(0,l.jsx)(lp.f,{author:n,permaslug:d,className:"size-3.5",frame:!0})}),u[4]=d,u[5]=n,u[6]=a):a=u[6],u[7]!==d?(s=eF(d),u[7]=d,u[8]=s):s=u[8],u[9]!==m||u[10]!==d?(i=e$(eL(d),m),u[9]=m,u[10]=d,u[11]=i):i=u[11],u[12]!==s||u[13]!==i?(c=(0,l.jsx)(lb.Link,{href:s,className:lI,children:i}),u[12]=s,u[13]=i,u[14]=c):c=u[14],u[15]!==m.model||u[16]!==r||u[17]!==a||u[18]!==c?(o=(0,l.jsxs)("span",{className:r,title:x,children:[a,c]}),u[15]=m.model,u[16]=r,u[17]=a,u[18]=c,u[19]=o):o=u[19],o}function l6(e){let r,n,a,s,i=(0,t.c)(26),{group:c,column:o}=e;i[0]!==o?(r=$(o),i[0]=o,i[1]=r):r=i[1];let u=r;if(null!==u){let e;return i[2]!==o||i[3]!==u?(e=(0,l.jsx)(l5,{column:o,model:u,isFlat:!0}),i[2]=o,i[3]=u,i[4]=e):e=i[4],e}if(l8(c)){let e,t,r,n;i[5]!==c.family||i[6]!==c.provider?(e=eR(c.family,c.provider),i[5]=c.family,i[6]=c.provider,i[7]=e):e=i[7],i[8]!==o.model||i[9]!==o.routeModels?(t=eB(o.model,o.routeModels),i[8]=o.model,i[9]=o.routeModels,i[10]=t):t=i[10];let a=`${e} \xb7 ${t}`;return i[11]!==o||i[12]!==a?(r=e$(a,o),i[11]=o,i[12]=a,i[13]=r):r=i[13],i[14]!==c||i[15]!==r?(n=(0,l.jsx)(l7,{group:c,label:r}),i[14]=c,i[15]=r,i[16]=n):n=i[16],n}i[17]!==c.family||i[18]!==c.provider?(n=eR(c.family,c.provider),i[17]=c.family,i[18]=c.provider,i[19]=n):n=i[19];let m=n,d=c.family===k.f.Auto&&o.costTier===v.B.Medium?null:o.costTier;return i[20]!==m||i[21]!==d?(a=null===d?m:`${m} (${d.charAt(0).toUpperCase()}${d.slice(1)})`,i[20]=m,i[21]=d,i[22]=a):a=i[22],i[23]!==c||i[24]!==a?(s=(0,l.jsx)(l7,{group:c,label:a}),i[23]=c,i[24]=a,i[25]=s):s=i[25],s}function l7({group:e,label:t=eR(e.family,e.provider)}){return(0,l.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm font-medium",children:[(0,l.jsx)("span",{"aria-hidden":"true",className:"flex shrink-0",children:(0,l.jsx)(lp.f,{author:(0,ew.x)(e.family),permaslug:e.family,className:"size-4",frame:!0})}),(0,l.jsx)(lb.Link,{href:eF(e.family),className:lI,children:t})]})}function l8(e){return e.family===k.f.Switchyard}function l9(e){let r,n,a,i,c=(0,t.c)(13),{metric:o,value:u,isBest:m}=e,d=(0,ec.useLocale)();if(null===u){let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,l.jsx)(s.T,{children:"Unknown"})}),c[0]=e):e=c[0],e}let h=m&&"font-semibold text-positive-text";return c[1]!==h?(r=(0,eA.f)("inline-flex items-center gap-1 text-xs font-medium tabular-nums",h),c[1]=h,c[2]=r):r=c[2],c[3]!==m?(n=m&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(lF.f,{"aria-hidden":"true",className:"size-3"}),(0,l.jsx)("span",{className:"sr-only",children:(0,l.jsx)(s.T,{children:"Best in benchmark"})})]}),c[3]=m,c[4]=n):n=c[4],c[5]!==d||c[6]!==o||c[7]!==u?(a=({score:ey.g,quality:ey.Z,cache:ey.Z,speed:ey.E,cost:ey.J,costPerSuccess:ey.J})[o](d,u),c[5]=d,c[6]=o,c[7]=u,c[8]=a):a=c[8],c[9]!==r||c[10]!==n||c[11]!==a?(i=(0,l.jsxs)("span",{className:r,children:[n,a]}),c[9]=r,c[10]=n,c[11]=a,c[12]=i):i=c[12],i}var te=e.i(328262),tl=e.i(797521);function tt(){let e,r=(0,t.c)(1);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)("p",{className:"text-left text-xs font-normal leading-relaxed",children:(0,l.jsx)(s.T,{children:"A 0–10 score combining quality, speed, and cost relative to the best router on each benchmark. Adjust the weights to your preference. Missing metrics are excluded."})}),r[0]=e):e=r[0],e}function tr(e){let r,n,a,i,c,o,u,m=(0,t.c)(15),{shouldShowCalculation:d}=e,h=void 0!==d&&d,f=(0,eZ.o)(),x=(0,tl.f)();m[0]!==x?(r=x.number(10,{preset:"integer"}),m[0]=x,m[1]=r):r=m[1];let p=r;m[2]!==x?(n=x.number(100,{preset:"integer"}),m[2]=x,m[3]=n):n=m[3];let b=n;return m[4]!==f?(a=f("How the Model Routing Index is calculated"),m[4]=f,m[5]=a):a=m[5],m[6]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)(l$.f,{className:"size-3.5 text-muted-foreground"}),m[6]=i):i=m[6],m[7]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsx)(tt,{}),m[7]=c):c=m[7],m[8]!==p||m[9]!==h||m[10]!==b?(o=h&&(0,l.jsx)("p",{className:"mt-2 text-left text-xs font-normal leading-relaxed",children:(0,l.jsxs)(s.T,{children:["Quality uses accuracy relative to the best result. Cost and speed use log-scaled ratios:"," ",(0,l.jsx)(eo.d,{children:p}),"× worse earns half credit; ",(0,l.jsx)(eo.d,{children:b}),"× worse earns none. Available metrics are reweighted and combined."]})}),m[8]=p,m[9]=h,m[10]=b,m[11]=o):o=m[11],m[12]!==a||m[13]!==o?(u=(0,l.jsxs)(te.InfoTooltip,{"aria-label":a,contentClassName:"max-w-72",icon:i,isFocusable:!0,children:[c,o]}),m[12]=a,m[13]=o,m[14]=u):u=m[14],u}var tn=e.i(790316),ta=e.i(678541),ts=e.i(89427),ti=e.i(789073),tc=e.i(609623),to=e.i(960773),tu=e.i(658045);let tm={quality:"bg-primary",speed:"bg-primary/55",cost:"bg-primary/25"},td="block size-3.5 cursor-grab rounded-full border-2 border-background bg-primary shadow-lg transition-colors focus-visible:outline-hidden focus-visible:border-focus-border focus-visible:shadow-focus active:cursor-grabbing data-[dragging]:cursor-grabbing";function th(e){let[l=0,t=100]=e,r=tx(Math.min(l,t)),n=tx(Math.max(l,t));return{quality:r,speed:n-r,cost:100-n}}function tf(e){let n,a,i,c,o,u,m,d,h,f,x,p,b,g,j,y,_,w,k,v,S,N,T,M,C,z,q,R,B,P,$,F=(0,t.c)(77),{portions:L,onChange:A}=e,H=(0,eZ.o)(),I=(0,to.Q)(),V=(0,tl.f)();F[0]!==L?(n=e8.every(e=>L[e]===e9[e]),F[0]=L,F[1]=n):n=F[1];let O=n;F[2]!==H?(a=H("Quality"),F[2]=H,F[3]=a):a=F[3],F[4]!==H?(i=H("Speed"),F[4]=H,F[5]=i):i=F[5],F[6]!==H?(c=H("Cost"),F[6]=H,F[7]=c):c=F[7],F[8]!==a||F[9]!==i||F[10]!==c?(o={quality:a,speed:i,cost:c},F[8]=a,F[9]=i,F[10]=c,F[11]=o):o=F[11];let E=o;F[12]!==V?(u=e=>V.percentPoints(e,{preset:"native-fixed-0"})??`${e}%`,F[12]=V,F[13]=u):u=F[13];let J=u;(F[14]!==J||F[15]!==E||F[16]!==L?(m=e8.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 whitespace-nowrap",children:[(0,l.jsx)("span",{"aria-hidden":"true",className:(0,eA.f)("size-1.5 rounded-full",tm[e])}),E[e],(0,l.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:J(L[e])})]},e)),F[14]=J,F[15]=E,F[16]=L,F[17]=m):m=F[17],F[18]!==m?(d=(0,l.jsx)("div",{className:"flex justify-between text-overline text-muted-foreground",children:m}),F[18]=m,F[19]=d):d=F[19],F[20]!==H?(h=H("Model Routing Index weights"),F[20]=H,F[21]=h):h=F[21],F[22]!==L)?(f=[L.quality,L.quality+L.speed],F[22]=L,F[23]=f):f=F[23],F[24]!==A?(x=e=>{A(th(e))},F[24]=A,F[25]=x):x=F[25],F[26]!==I?(p=e=>{I.capture("change_router_score_weights",th(e))},F[26]=I,F[27]=p):p=F[27],F[28]!==L?(b=e8.map(e=>(0,l.jsx)("span",{"data-portion":e,"data-allow-inline-style":!0,style:{"--portion-weight":L[e]},className:(0,eA.f)("h-full basis-0 grow-(--portion-weight)",tm[e])},e)),F[28]=L,F[29]=b):b=F[29],F[30]!==b?(g=(0,l.jsx)(tn.f.Track,{className:"relative flex h-1.5 w-full grow overflow-hidden rounded-full bg-muted",children:b}),F[30]=b,F[31]=g):g=F[31],F[32]!==H?(j=H("Quality and speed split"),F[32]=H,F[33]=j):j=F[33],F[34]!==j?(y=(0,l.jsx)(ta.f.Thumb,{index:0,"aria-label":j,className:td}),F[34]=j,F[35]=y):y=F[35],F[36]!==H?(_=H("Speed and cost split"),F[36]=H,F[37]=_):_=F[37],F[38]!==_?(w=(0,l.jsx)(ta.f.Thumb,{index:1,"aria-label":_,className:td}),F[38]=_,F[39]=w):w=F[39],F[40]!==g||F[41]!==y||F[42]!==w?(k=(0,l.jsxs)(ts.f.Control,{className:"relative flex h-4 w-full cursor-pointer items-center",children:[g,y,w]}),F[40]=g,F[41]=y,F[42]=w,F[43]=k):k=F[43],F[44]!==f||F[45]!==x||F[46]!==p||F[47]!==k||F[48]!==h?(v=(0,l.jsx)(ti.f.Root,{"aria-label":h,value:f,min:0,max:100,step:5,onValueChange:x,onValueCommitted:p,className:"relative flex w-full touch-none select-none items-center",children:k}),F[44]=f,F[45]=x,F[46]=p,F[47]=k,F[48]=h,F[49]=v):v=F[49],F[50]!==v||F[51]!==d?(S=(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2 md:w-64 md:flex-none md:gap-1",children:[d,v]}),F[50]=v,F[51]=d,F[52]=S):S=F[52];let Q=!O;F[53]!==H?(N=H("About Model Routing Index weights"),F[53]=H,F[54]=N):N=F[54],F[55]===Symbol.for("react.memo_cache_sentinel")?(T=(0,l.jsx)(l$.f,{className:"size-3.5 text-muted-foreground"}),F[55]=T):T=F[55],F[56]===Symbol.for("react.memo_cache_sentinel")?(M=(0,l.jsx)(s.T,{children:"Drag to change how much quality, speed and cost count toward the Model Routing Index."}),F[56]=M):M=F[56],F[57]!==N?(C=(0,l.jsx)(te.InfoTooltip,{"aria-label":N,icon:T,contentClassName:"max-w-60",side:"bottom",children:M}),F[57]=N,F[58]=C):C=F[58],F[59]!==H?(z=H("Reset Model Routing Index weights"),F[59]=H,F[60]=z):z=F[60];let K=O?-1:void 0;return F[61]!==A||F[62]!==I?(q=()=>{A(e9),I.capture("reset_router_score_weights")},F[61]=A,F[62]=I,F[63]=q):q=F[63],F[64]===Symbol.for("react.memo_cache_sentinel")?(R=(0,l.jsx)(tu.f,{}),F[64]=R):R=F[64],F[65]!==O||F[66]!==z||F[67]!==K||F[68]!==q?(B=(0,l.jsx)(r.Button,{variant:"ghost",size:"icon-sm","aria-label":z,"aria-hidden":O,tabIndex:K,onClick:q,children:R}),F[65]=O,F[66]=z,F[67]=K,F[68]=q,F[69]=B):B=F[69],F[70]!==Q||F[71]!==C||F[72]!==B?(P=(0,l.jsx)(tc.f,{active:Q,className:"size-8 place-items-center *:data-[active=false]:pointer-events-none",from:C,to:B}),F[70]=Q,F[71]=C,F[72]=B,F[73]=P):P=F[73],F[74]!==S||F[75]!==P?($=(0,l.jsxs)("div",{className:"flex items-center gap-3 md:gap-2",children:[S,P]}),F[74]=S,F[75]=P,F[76]=$):$=F[76],$}function tx(e){return Math.min(100,Math.max(0,Math.round(e)))}function tp(e){let r,n,a,i,c,o,u,m,d,h,f,x,p,b,g,j,y,_,w,k,v,S,T,M,C,z,q,R,B,P,$=(0,t.c)(75),{matrix:F,usage:L,isUsagePending:A,scorePortions:H,onScorePortionsChange:I}=e,V=(0,eu.f)(),[O,E]=(0,eb.useState)("quality");$[0]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{let l=N.find(l=>l===e);l&&E(l)},$[0]=r):r=$[0];let J=r;$[1]!==V?(n=V("Model Routing Index"),$[1]=V,$[2]=n):n=$[2],$[3]!==V?(a=V("Quality"),$[3]=V,$[4]=a):a=$[4],$[5]!==V?(i=V("Cache hit"),$[5]=V,$[6]=i):i=$[6],$[7]!==V?(c=V("Cost / success"),$[7]=V,$[8]=c):c=$[8],$[9]!==V?(o=V("Cost / task"),$[9]=V,$[10]=o):o=$[10],$[11]!==V?(u=V("Time / task"),$[11]=V,$[12]=u):u=$[12],$[13]!==n||$[14]!==a||$[15]!==i||$[16]!==c||$[17]!==o||$[18]!==u?(m={score:n,quality:a,cache:i,costPerSuccess:c,cost:o,speed:u},$[13]=n,$[14]=a,$[15]=i,$[16]=c,$[17]=o,$[18]=u,$[19]=m):m=$[19];let Q=m;return $[20]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)("h2",{children:(0,l.jsx)(s.T,{children:"Benchmark matrix"})}),$[20]=d):d=$[20],$[21]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)(s.T,{children:"The Model Routing Index combines quality, speed, and cost into a 0–10 score relative to the best results on each benchmark."}),$[21]=h):h=$[21],$[22]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[d,(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:[h," ",(0,l.jsx)(lB.TextLink,{href:"#efficiency",children:(0,l.jsx)(s.T,{children:"Explore the Model Routing Frontier"})}),"."]})]}),$[22]=f):f=$[22],$[23]!==V?(x=V("Comparison metric"),$[23]=V,$[24]=x):x=$[24],$[25]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.jsx)(eG.SelectValue,{}),$[25]=p):p=$[25],$[26]!==x?(b=(0,l.jsx)(eG.SelectTrigger,{"aria-label":x,className:"min-w-0 flex-1",children:p}),$[26]=x,$[27]=b):b=$[27],$[28]!==Q?(g=N.map(e=>(0,l.jsx)(eG.SelectItem,{value:e,children:Q[e]},e)),$[28]=Q,$[29]=g):g=$[29],$[30]!==g?(j=(0,l.jsx)(eG.SelectContent,{children:g}),$[30]=g,$[31]=j):j=$[31],$[32]!==O||$[33]!==b||$[34]!==j?(y=(0,l.jsxs)(eG.Select,{value:O,onValueChange:J,size:"compact",children:[b,j]}),$[32]=O,$[33]=b,$[34]=j,$[35]=y):y=$[35],$[36]!==O?(_="score"===O&&(0,l.jsx)(tr,{}),$[36]=O,$[37]=_):_=$[37],$[38]!==y||$[39]!==_?(w=(0,l.jsxs)("div",{className:"flex items-center gap-3 md:hidden",children:[y,_]}),$[38]=y,$[39]=_,$[40]=w):w=$[40],$[41]!==V?(k=V("Comparison metric"),$[41]=V,$[42]=k):k=$[42],$[43]!==Q?(v=N.map(e=>"score"===e?(0,l.jsx)(lP.Tooltip,{side:"bottom",className:"max-w-72",content:(0,l.jsx)(tt,{}),children:(0,l.jsx)(lR.k,{value:e,children:(0,l.jsxs)("span",{className:"flex items-center gap-1.5",children:[Q[e],(0,l.jsx)(l$.f,{"aria-hidden":"true",className:"size-3.5 text-muted-foreground"})]})})},e):(0,l.jsx)(lR.k,{value:e,children:Q[e]},e)),$[43]=Q,$[44]=v):v=$[44],$[45]!==k||$[46]!==v?(S=(0,l.jsx)(lR.U,{className:"hidden justify-start md:flex","aria-label":k,children:v}),$[45]=k,$[46]=v,$[47]=S):S=$[47],$[48]!==O||$[49]!==I||$[50]!==H?(T="score"===O&&(0,l.jsx)(tf,{portions:H,onChange:I}),$[48]=O,$[49]=I,$[50]=H,$[51]=T):T=$[51],$[52]!==w||$[53]!==S||$[54]!==T?(M=(0,l.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between md:gap-4",children:[w,S,T]}),$[52]=w,$[53]=S,$[54]=T,$[55]=M):M=$[55],$[56]!==F||$[57]!==O||$[58]!==H||$[59]!==L?(C=(0,l.jsx)(lV,{matrix:F,usage:L,metric:O,scorePortions:H}),$[56]=F,$[57]=O,$[58]=H,$[59]=L,$[60]=C):C=$[60],$[61]!==O||$[62]!==C?(z=(0,l.jsx)(lR.S,{value:O,className:"mt-4 md:mt-2",children:C}),$[61]=O,$[62]=C,$[63]=z):z=$[63],$[64]!==O||$[65]!==M||$[66]!==z?(q=(0,l.jsxs)(lR.i,{value:O,onValueChange:J,variant:"secondary",children:[M,z]}),$[64]=O,$[65]=M,$[66]=z,$[67]=q):q=$[67],$[68]===Symbol.for("react.memo_cache_sentinel")?(R=(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,l.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,l.jsx)(s.T,{children:"Better"}),(0,l.jsx)("span",{"aria-hidden":"true",className:`h-2 w-16 rounded-sm ${lg.default.legend}`}),(0,l.jsx)(s.T,{children:"Worse"})]}),(0,l.jsx)("span",{children:(0,l.jsx)(s.T,{children:"Single model baselines are shown for reference and are not ranked."})})]}),$[68]=R):R=$[68],$[69]!==A||$[70]!==O?(B=A&&"cache"===O&&(0,l.jsx)("p",{role:"status",className:"text-xs text-muted-foreground",children:(0,l.jsx)(s.T,{children:"Loading cache usage…"})}),$[69]=A,$[70]=O,$[71]=B):B=$[71],$[72]!==q||$[73]!==B?(P=(0,l.jsxs)("section",{id:"all-benchmarks",className:`flex flex-col gap-3 ${eH.w}`,children:[f,q,R,B]}),$[72]=q,$[73]=B,$[74]=P):P=$[74],P}var tb=e.i(30368);function tg(e){let r,n,a,s,i,c,o,u=(0,t.c)(20),{icons:m,value:d,label:h,hint:f,iconLabels:x,formatters:p}=e;u[0]!==m?(r=m.slice(0,4),u[0]=m,u[1]=r):r=u[1];let b=r,g=Math.max(0,m.length-b.length);return u[2]!==h?(n=(0,l.jsx)("dt",{className:"text-xs font-medium text-foreground",children:h}),u[2]=h,u[3]=n):n=u[3],u[4]!==p||u[5]!==g||u[6]!==x?(a=g>0&&(0,l.jsx)(te.InfoTooltip,{icon:(0,l.jsxs)("span",{className:"flex size-5 items-center justify-center rounded-sm border border-border bg-muted text-[0.625rem] font-medium tabular-nums",children:["+",g]}),children:p.list(x.slice(4))}),u[4]=p,u[5]=g,u[6]=x,u[7]=a):a=u[7],u[8]!==a||u[9]!==b?(s=(0,l.jsxs)("dd",{className:"flex min-h-7 items-center gap-1.5",children:[b,a]}),u[8]=a,u[9]=b,u[10]=s):s=u[10],u[11]!==d?(i=(0,l.jsx)("dd",{className:"text-sm font-semibold text-foreground",children:d}),u[11]=d,u[12]=i):i=u[12],u[13]!==f?(c=(0,l.jsx)("dd",{className:"text-2xs leading-snug text-muted-foreground",children:f}),u[13]=f,u[14]=c):c=u[14],u[15]!==n||u[16]!==s||u[17]!==i||u[18]!==c?(o=(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 bg-background p-4",children:[n,s,i,c]}),u[15]=n,u[16]=s,u[17]=i,u[18]=c,u[19]=o):o=u[19],o}function tj(e){let r,n,a,s,i=(0,t.c)(10),{value:c,label:o,hint:u}=e;return i[0]!==o?(r=(0,l.jsx)("dt",{className:"text-xs font-medium text-foreground",children:o}),i[0]=o,i[1]=r):r=i[1],i[2]!==c?(n=(0,l.jsx)("dd",{className:"text-2xl font-semibold tabular-nums text-foreground",children:c}),i[2]=c,i[3]=n):n=i[3],i[4]!==u?(a=(0,l.jsx)("dd",{className:"text-2xs leading-snug text-muted-foreground",children:u}),i[4]=u,i[5]=a):a=i[5],i[6]!==r||i[7]!==n||i[8]!==a?(s=(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5 bg-background p-4",children:[r,n,a]}),i[6]=r,i[7]=n,i[8]=a,i[9]=s):s=i[9],s}function ty(e){let l=[...Map.groupBy(e,e=>e.split("/")[0]??e).values()];return Array.from({length:Math.max(0,...l.map(e=>e.length))},(e,t)=>l.flatMap(e=>e[t]??[])).flat()}function t_(e){let r,n,a,i,c,o,u,m,d,h=(0,t.c)(24),{matrix:f,usage:x,isUsageComplete:p}=e,b=(0,eZ.o)(),g=(0,ec.useLocale)();if(h[0]!==b||h[1]!==p||h[2]!==g||h[3]!==f.rows||h[4]!==x){var j;let e,t,o,u,m,d,y,_,w=(0,tb.f)(g),{routers:k,models:v,results:S}=(j=f.rows,m=new Set((u=j.flatMap(e=>e.cells).filter(e=>null!==e.run)).map(e=>e.run?.workflow_id)),d=u.filter(e=>!F(e.column)).map(e=>e.column.family),y=u.flatMap(e=>H(e.column.model,e.column.routeModels)),_=x.filter(e=>m.has(e.workflow_id)).map(e=>e.model_permaslug),{routers:ty([...new Set(d)].toSorted()),models:ty([...new Set([...y,..._])].toSorted()),results:u.length}),N=k.map(eL),T=function(e,{list:l,gt:t}){if(!e.some(B))return l(e.map(eL));let r=e.filter(e=>!B(e));return 0===r.length?t("Switchyard model switching"):t("{routers} plus Switchyard model switching",{routers:l(r.map(eL))})}(k,{list:w.list,gt:b}),M=v.map(eL);a="grid gap-px overflow-hidden rounded-xl border border-border bg-border sm:grid-cols-3 lg:w-4/5",h[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(s.T,{children:"Routers"}),h[10]=e):e=h[10],i=(0,l.jsx)(tg,{icons:k.map(tk),value:b("{count, plural, one {# router} other {# routers}}",{count:k.length}),label:e,hint:T,iconLabels:N,formatters:w}),h[11]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)(s.T,{children:"Models"}),h[11]=t):t=h[11],h[12]!==p?(o=p?(0,l.jsx)(s.T,{children:"routed to by routers or run as baselines"}):(0,l.jsx)(s.T,{children:"Route and baseline models only; router model choices are unavailable"}),h[12]=p,h[13]=o):o=h[13],c=(0,l.jsx)(tg,{icons:v.map(tw),value:b("{count, plural, one {# model} other {# models}}",{count:v.length}),label:t,hint:o,iconLabels:M,formatters:w}),r=tj,n=w.number(S,{preset:"integer"})??String(S),h[0]=b,h[1]=p,h[2]=g,h[3]=f.rows,h[4]=x,h[5]=r,h[6]=n,h[7]=a,h[8]=i,h[9]=c}else r=h[5],n=h[6],a=h[7],i=h[8],c=h[9];return h[14]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsx)(s.T,{children:"Results"}),u=(0,l.jsx)(s.T,{children:"published router and baseline runs"}),h[14]=o,h[15]=u):(o=h[14],u=h[15]),h[16]!==r||h[17]!==n?(m=(0,l.jsx)(r,{value:n,label:o,hint:u}),h[16]=r,h[17]=n,h[18]=m):m=h[18],h[19]!==a||h[20]!==i||h[21]!==c||h[22]!==m?(d=(0,l.jsxs)("dl",{className:a,children:[i,c,m]}),h[19]=a,h[20]=i,h[21]=c,h[22]=m,h[23]=d):d=h[23],d}function tw(e){return(0,l.jsx)(lp.f,{author:(0,ew.x)(e),permaslug:e,className:"size-5",frame:!0},e)}function tk(e){return(0,l.jsx)(lp.f,{author:(0,ew.x)(e),permaslug:e,className:"size-5",frame:!0},e)}function tv(e){let n,a,i,c,o,u,m,d,h,f,x,p,b,g,j,y,w,k,v,S,N,T,M=(0,t.c)(66),{matrix:C}=e,z=(0,eu.f)(),q=(0,ec.useLocale)(),[R,B]=(0,eb.useState)(e9);M[0]===Symbol.for("react.memo_cache_sentinel")?(n=ep.d.withOptions({history:"push"}),M[0]=n):n=M[0];let[P,$]=(0,ep.o)("benchmark",n),{models:F,isPending:L,isError:A}=function(e){let l,r,n=(0,t.c)(3);if(n[0]!==e){let t=[...Map.groupBy(e,ei).values()].flatMap(ea);l=_.f,r={queries:t.map(ee),combine:el},n[0]=e,n[1]=l,n[2]=r}else l=n[1],r=n[2];return l(r)}(C.selectedRuns);if(M[1]!==P||M[2]!==C.rows){let e;M[4]!==P?(e=e=>e.benchmark===P,M[4]=P,M[5]=e):e=M[5],a=C.rows.find(e),M[1]=P,M[2]=C.rows,M[3]=a}else a=M[3];let H=a;if(M[6]!==q||M[7]!==C.selectedRuns){var I;I=C.selectedRuns.map(tS).toSorted().at(-1),i=(0,ej.v)(I,ey.m.bind(void 0,q)),M[6]=q,M[7]=C.selectedRuns,M[8]=i}else i=M[8];let V=i,O=!L&&!A;M[9]!==C||M[10]!==O||M[11]!==F?(c=(0,l.jsx)(t_,{matrix:C,usage:F,isUsageComplete:O}),M[9]=C,M[10]=O,M[11]=F,M[12]=c):c=M[12],M[13]!==V||M[14]!==z?(o=null!==V&&(0,l.jsx)(eg,{prefix:z("Last benchmark run"),freshness:V}),M[13]=V,M[14]=z,M[15]=o):o=M[15],M[16]!==C.truncated?(u=C.truncated&&(0,l.jsx)("p",{role:"status",className:"text-sm text-warning",children:(0,l.jsx)(s.T,{children:"Showing the newest 2,000 runs. Older history is omitted."})}),M[16]=C.truncated,M[17]=u):u=M[17],M[18]!==H||M[19]!==P||M[20]!==$?(m=P&&!H&&(0,l.jsxs)("div",{role:"status",className:"flex flex-wrap items-center gap-3 text-sm",children:[(0,l.jsxs)(s.T,{children:["No published results for ",(0,l.jsx)(eo.d,{children:ez(P)}),"."]}),(0,l.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>void $(null),children:(0,l.jsx)(s.T,{children:"Show available benchmarks"})})]}),M[18]=H,M[19]=P,M[20]=$,M[21]=m):m=M[21];let E=C.rows.length>0;M[22]!==z?(d=z("Model Routing Frontier"),M[22]=z,M[23]=d):d=M[23],M[24]!==d?(h={id:"efficiency",label:d,icon:eh},M[24]=d,M[25]=h):h=M[25],M[26]!==z?(f=z("Benchmark matrix"),M[26]=z,M[27]=f):f=M[27],M[28]!==f?(x={id:"all-benchmarks",label:f,icon:ex.f},M[28]=f,M[29]=x):x=M[29],M[30]!==z?(p=z("Model routing results"),M[30]=z,M[31]=p):p=M[31],M[32]!==p?(b={id:"results",label:p,icon:ef.f},M[32]=p,M[33]=b):b=M[33],M[34]!==h||M[35]!==x||M[36]!==b?(g=[h,x,b],M[34]=h,M[35]=x,M[36]=b,M[37]=g):g=M[37],M[38]===Symbol.for("react.memo_cache_sentinel")?(j=[],M[38]=j):j=M[38];let J=H?.benchmark??null;return M[39]!==$?(y=e=>{$(e)},M[39]=$,M[40]=y):y=M[40],M[41]!==C.rows||M[42]!==J||M[43]!==y?(w=(0,l.jsx)(lz,{allRows:C.rows,benchmark:J,onBenchmarkChange:y}),M[41]=C.rows,M[42]=J,M[43]=y,M[44]=w):w=M[44],M[45]!==L||M[46]!==C||M[47]!==R||M[48]!==F?(k=(0,l.jsx)(tp,{matrix:C,usage:F,isUsagePending:L,scorePortions:R,onScorePortionsChange:B}),M[45]=L,M[46]=C,M[47]=R,M[48]=F,M[49]=k):k=M[49],M[50]!==C.rows?(v=(0,l.jsx)(lq,{rows:C.rows}),M[50]=C.rows,M[51]=v):v=M[51],M[52]!==w||M[53]!==k||M[54]!==v?(S=(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-10",children:[w,k,v]}),M[52]=w,M[53]=k,M[54]=v,M[55]=S):S=M[55],M[56]!==g||M[57]!==S||M[58]!==E?(N=(0,l.jsx)(e_.f,{hasData:E,dataSections:g,staticSections:j,children:S}),M[56]=g,M[57]=S,M[58]=E,M[59]=N):N=M[59],M[60]!==N||M[61]!==c||M[62]!==o||M[63]!==u||M[64]!==m?(T=(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-8",children:[c,o,u,m,N]}),M[60]=N,M[61]=c,M[62]=o,M[63]=u,M[64]=m,M[65]=T):T=M[65],T}function tS(e){return e.timestamp}e.i(912147),e.i(487980),e.i(497802),e.i(2819),e.s(["RouterBenchmarks",0,function(){let e,c,o,u=(0,t.c)(13);u[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,y.f)({queryKey:Y.results(),queryFn:({signal:e})=>(0,i.f)(w,{signal:e}).then(e=>{var l;return{...l=(0,m.u)((0,d.C)(b,e)),runs:l.runs.flatMap(e=>{let l=f[e.model_permaslug];return void 0!==l?[{...e,model_permaslug:l}]:e.model_permaslug.startsWith("stealth/")?[]:[e]})}}),select:e=>(function({runs:e,truncated:l},t){var r;let n,a={runs:e.filter(e=>{var l;return!x.includes(e.benchmark_type)&&(!B((l=e).model_permaslug)||H(l.model_permaslug,l.route_models).length>0)}).map(P),truncated:l},s=(n=new Set((r=[...new Map(a.runs.map(e=>[Q(e),function(e){let l=O(e);return{key:Q(e),family:B(l)?k.f.Switchyard:l,model:l,provider:E(e),routeModels:I(e),reasoningEffort:J(e),costTier:e.cost_tier}}(e)])).values()]).flatMap(e=>null===e.costTier?[]:[K(e)])),r.filter(e=>null!==e.costTier||!n.has(K(e)))).toSorted(U),i=[...new Map(s.map(e=>{var l;return[JSON.stringify([(l=e).family,l.provider]),e]})).values()].map(({family:e,provider:l})=>({key:JSON.stringify([e,l]),family:e,provider:l,columns:s.filter(t=>t.family===e&&t.provider===l)})),c=Map.groupBy(a.runs,e=>JSON.stringify([e.benchmark_type,Q(e)])),o=[...new Set(a.runs.map(e=>e.benchmark_type))].toSorted().map(e=>({benchmark:e,cells:s.map(l=>{let r=JSON.stringify([e,l.key]),n=(c.get(r)??[]).toSorted((e,l)=>Date.parse(l.timestamp)-Date.parse(e.timestamp)||Number(l.id>e.id)-Number(l.ide.id===t[r])??n[0]??null}})}));return{columns:s,groups:i,rows:o,truncated:a.truncated,selectedRuns:o.flatMap(e=>e.cells.flatMap(e=>e.run?[e.run]:[]))}})(e,{})}),u[0]=e):e=u[0];let{data:h,isPending:p,isError:g,refetch:j}=(0,a.f)(e);if(p){let e;return u[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.l,{className:"h-80 w-full"}),u[1]=e):e=u[1],e}if(g){let e,t,n,a;return u[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(s.T,{children:"Results could not be loaded."}),u[2]=e):e=u[2],u[3]!==j?(t=()=>void j(),u[3]=j,u[4]=t):t=u[4],u[5]===Symbol.for("react.memo_cache_sentinel")?(n=(0,l.jsx)(s.T,{children:"Retry"}),u[5]=n):n=u[5],u[6]!==t?(a=(0,l.jsxs)("div",{role:"alert",className:"flex items-center gap-3",children:[e,(0,l.jsx)(r.Button,{variant:"outline",onClick:t,children:n})]}),u[6]=t,u[7]=a):a=u[7],a}if(u[8]!==h){let e;e=h.rows.filter(e=>e.cells.filter(e=>null!==e.run).length>=5),c={...h,rows:e,selectedRuns:e.flatMap(e=>e.cells.flatMap(e=>e.run?[e.run]:[]))},u[8]=h,u[9]=c}else c=u[9];let _=c;if(0===_.rows.length){let e;return u[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)("div",{className:"rounded-lg border p-6",children:(0,l.jsx)(s.T,{children:"No benchmark results available."})}),u[10]=e):e=u[10],e}return u[11]!==_?(o=(0,l.jsx)(tv,{matrix:_}),u[11]=_,u[12]=o):o=u[12],o}],358370)},408253,e=>{e.v({heat:"PWetKq_heat",legend:"PWetKq_legend",sortHeader:"PWetKq_sortHeader"})}]); //# sourceMappingURL=0zo18smrekedp.js.map