!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="05070f4b-e1c4-40a0-946c-14f81b6039cc",e._sentryDebugIdIdentifier="sentry-dbid-05070f4b-e1c4-40a0-946c-14f81b6039cc")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[166],{64998:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},76915:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},92509:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},47737:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},84617:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]])},49482:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},87764:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},49525:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var s=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=(0,s.Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},51782:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/evals",function(){return a(54527)}])},28220:function(e,t,a){"use strict";var s=a(85893);a(23238),a(82567);var l=a(67294),n=a(30286),r=a(48830);let i=e=>{let{dateOptions:t,selectedValue:a,onChange:i,dateRange:o}=e,[d,c]=(0,l.useState)(null!=o?o:null),[u,x]=(0,l.useState)(!1),v={key:"selection",startDate:new Date((null==d?void 0:d.startDate)?d.startDate:new Date().getTime()-6048e5),endDate:(null==d?void 0:d.endDate)?new Date(d.endDate):new Date},m=d&&d.startDate&&d.endDate,p=e=>{c(e.selection)},y=()=>{if(m){let e={startDate:(0,r.PJ)(d.startDate,"yyyy-MM-dd"),endDate:(0,r.PJ)(d.endDate,"yyyy-MM-dd")};i(0,e)}x(!1)},f=()=>{c(null),i(null,null),x(!1)},h=m?null:a;return(0,s.jsxs)("div",{className:"relative flex items-center p-1 gap-2 border rounded border-slate-200","data-sentry-component":"DateSpanSelector","data-sentry-source-file":"DateSpanSelector.tsx",children:[t.map(e=>(0,s.jsx)("div",{className:"py-1 px-3 text-xs rounded hover:bg-black hover:text-white cursor-pointer ".concat(e===h?"bg-black text-white":"bg-white text-slate-400"),onClick:()=>i(e,null),children:"".concat(e,"d")},e)),(0,s.jsx)("div",{className:"py-1 px-3 text-xs rounded hover:bg-black hover:text-white cursor-pointer ".concat(m?"bg-black text-white":"bg-white text-slate-400"),onClick:()=>x(!0),children:"Custom"}),u&&(0,s.jsxs)("div",{className:"absolute top-full right-0 z-10 bg-white shadow-md rounded-md mt-2",children:[m&&(0,s.jsx)("div",{className:"px-4 py-2 bg-slate-100 text-[14px] text-slate-600 hover:bg-slate-200 w-[100%] flex-1 text-center cursor-pointer",onClick:f,children:"\xd7 Clear Selection"}),(0,s.jsx)(n.Dw,{ranges:[v],onChange:p}),(0,s.jsxs)("div",{className:"flex justify-end p-2",children:[(0,s.jsx)("button",{type:"button",className:"mr-2 bg-gray-200 text-gray-800 px-4 py-2 rounded-md focus:outline-none",onClick:()=>x(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"bg-blue-500 text-white px-4 py-2 rounded-md focus:outline-none",onClick:y,children:"Apply"})]})]})]})};t.Z=i},50944:function(e,t,a){"use strict";var s=a(85893);a(67294);var l=a(26496);let n=e=>{let{selectedCount:t,onDeselect:a,actions:n}=e;return 0===t?null:(0,s.jsxs)("div",{className:"fixed bottom-0 right-0 left-auto w-3/4 bg-white border border-gray-200 shadow-lg mx-7 mb-7 z-10 rounded-2xl","data-sentry-component":"ListBottomBar","data-sentry-source-file":"ListBottomBar.tsx",children:[(0,s.jsx)("div",{className:"flex items-center justify-between pb-2 px-4 bg-gray-100 py-2 rounded-t-2xl",children:(0,s.jsxs)("div",{className:"text-sm text-black",children:[t," Selected"]})}),(0,s.jsx)("hr",{className:"border-t border-gray-200 mb-2"}),(0,s.jsxs)("div",{className:"flex gap-3 my-2",children:[(0,s.jsx)(l.z,{onClick:a,className:"text-sm font-light ml-4",variant:"ghost","data-sentry-element":"Button","data-sentry-source-file":"ListBottomBar.tsx",children:"Deselect"}),(0,s.jsx)("div",{className:"w-[1px] h-10 bg-gray-200 mr-2"}),n.map((e,t)=>(0,s.jsxs)(l.z,{onClick:e.onClick,variant:e.variant||"outline",className:"text-sm font-light",children:[e.icon&&(0,s.jsx)("span",{className:"mr-2",children:e.icon}),e.label]},t))]})]})};t.Z=n},22488:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var s=a(85893),l=a(45711);/**
 * @license lucide-react v0.372.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,l.Z)("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]),r=(0,l.Z)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),i=e=>{let{active:t}=e;return(0,s.jsxs)("div",{className:"cursor-default px-3 py-0 h-6 font-medium w-max flex flex-row items-center gap-1.5 rounded-full ".concat(t?"bg-emerald-100 text-emerald-700":"bg-zinc-100 text-zinc-600"),"data-sentry-component":"OnlineStatusBadge","data-sentry-source-file":"OnlineStatusBadge.tsx",children:[t?(0,s.jsx)(n,{className:"w-3 h-3"}):(0,s.jsx)(r,{className:"w-3 h-3 opacity-30"}),t?"Active":"Inactive"]})};var o=i},41551:function(e,t,a){"use strict";var s=a(85893);a(67294);var l=a(61677);let n=e=>{let{tabs:t,RightComponent:a,tabContainerClasses:n,tabHeaderClasses:r,value:i,onValueChange:o}=e;return(0,s.jsxs)(l.mQ,{defaultValue:t[0].value,className:n,value:i,onValueChange:o,"data-sentry-element":"Tabs","data-sentry-component":"SimpleTabBar","data-sentry-source-file":"SimpleTabBar.tsx",children:[(0,s.jsxs)("div",{className:"w-full border-b border-zinc-200 ".concat(r),children:[(0,s.jsx)(l.dr,{className:"w-64 flex justify-start gap-5 text-xs max-w-[200px] !bg-transparent !py-0 !px-6 h-[auto]","data-sentry-element":"TabsList","data-sentry-source-file":"SimpleTabBar.tsx",children:t.map(e=>(0,s.jsxs)(l.SP,{value:e.value,className:"!px-0 py-3 font-light text-xs !data-[state=active]:text-black !data-[state=active]:bg-transparent rounded-[0px] group relative",style:{boxShadow:"none"},children:[e.label,(0,s.jsx)("div",{className:"group-data-[state=active]:border-b-[2px] border-black absolute w-[calc(100%-5px)] h-[1px] bottom-[-1px] left-[50%] transform translate-x-[-50%] z-[1] "})]},e.value))}),a]}),t.map(e=>(0,s.jsx)(l.nU,{className:"h-full ".concat(e.tabClasses),value:e.value,children:e.content},e.value))]})};t.Z=n},54527:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return eC}});var s=a(85893),l=a(17030),n=a(67294),r=a(88767),i=a(51252),o=a(94994),d=a(24738),c=a(90427),u=a(25072),x=a(59887),v=a(27004),m=a(41551),p=a(93971),y=a(70094),f=a(62469),h=a(84979),g=a(8971),b=a(76915),j=a(49482),N=a(13718),w=a(31012),E=a(11163),D=a(87473),C=a(29009),L=a(94831),k=a(26050),S=a(18001),_=a(3023),T=a(75358),Z=a(50944),z=a(61677),M=a(74972),A=a(73302),B=a(70119),O=a(46794),I=a(26496),F=a(79342),R=a(74943),q=a(40116),G=a(36731),P=a(16546),V=a(40921);let W=()=>(0,r.useMutation)(async e=>{let{id:t}=e,a=await V.Z.delete("".concat((0,P.JW)(),"/").concat("api/v1/job_config","/").concat(t));return a.data});var H=a(44085);let U=e=>{let{evalConfigIds:t,closeModal:a,isOnline:l,onDeleteComplete:n}=e,{mutateAsync:i,isLoading:o}=(0,G.v)(),{mutateAsync:d,isLoading:c}=W();(0,r.useQueryClient)();let u=async()=>{let e=t.map(e=>l?d({id:e}):i({devEvalConfigId:e}));await Promise.all(e),n(),a()},x=l?"archive":"delete",v=l?"online":"offline",m="".concat((0,O.fm)(x)," ").concat(v," eval").concat(t.length>1?"s":""),p="Are you sure you want to ".concat(x," ").concat(t.length>1?t.length:"this"," ").concat(v," eval").concat(t.length>1?"s":"","?");return(0,s.jsx)(H.Z,{submitLabel:"".concat((0,O.fm)(x)," ").concat(t.length>1?t.length:"this"," ").concat(v," eval").concat(t.length>1?"s":""),isLoading:l?c:o,buttonType:"destructive",title:(0,s.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,s.jsx)(q.Z,{width:18,height:18,color:"red"}),(0,s.jsx)("span",{className:"pl-1 text-[16px]",children:m})]}),message:(0,s.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"px-2 text-[13px] text-zinc-700",children:p}),(0,s.jsx)("div",{className:"mt-2 p-2 px-4 bg-rose-100 rounded-md",children:(0,s.jsxs)("span",{className:"text-xs text-rose-600 leading-relaxed",children:["This will also delete the evaluation results associated with"," ",t.length>1?"these":"this"," evaluation config",t.length>1?"s":""," across all the datasets."]})})]}),onClose:a,onConfirm:u,className:"w-[450px]","data-sentry-element":"ConfirmationModal","data-sentry-component":"DeleteEvalConfigModal","data-sentry-source-file":"DeleteEvalConfigModal.tsx"})};var X=a(88342),J=a(18305),Q=a(14672),K=a(48830),$=a(41097),Y=a(37369);let ee=()=>{var e,t,a,l;let{applyFilters:r,filters:i}=(0,M.Z)(),{data:o}=(0,J.G)(),{data:d}=(0,X.Z)(),c=null!==(e=null==o?void 0:o.map(e=>({label:e.name,value:e.id})))&&void 0!==e?e:[],u=null!==(t=null==d?void 0:d.evals.map(e=>({label:e.label,value:e.id})))&&void 0!==t?t:[],[x,v]=(0,n.useState)(""),m=(0,E.useRouter)(),p=null!==(a=m.query.tab)&&void 0!==a?a:A.B.OnlineEvals,y=(0,n.useMemo)(()=>JSON.parse(null!==(l=i.tableFilters)&&void 0!==l?l:"[]"),[i]),h=e=>{r({tableFilters:JSON.stringify(e)})};(0,n.useEffect)(()=>{if(m.query.search!==x){var e;v(null!==(e=m.query.search)&&void 0!==e?e:"")}},[m.query]);let g=(0,n.useCallback)(e=>{m.push({query:{...m.query,search:e}})},[m.query]),b=(0,n.useCallback)((0,K.Ds)(g,500),[g]),j=e=>{v(e),b(e)},N=e=>{m.push({query:{...m.query,tab:e}})};(0,n.useEffect)(()=>{h([])},[p]);let{setCurrentModal:w,setCurrentEvalTabType:D}=(0,B.Z)();return(0,s.jsx)("div",{className:"w-full overflown-x-hidden mb-[30px]","data-sentry-component":"EvalListFilter","data-sentry-source-file":"EvalListFilter.tsx",children:(0,s.jsx)($.Z,{hideDateFilter:!0,currAppliedFilters:y,allFilters:p===A.B.OnlineEvals?ea:es,changeFilters:h,LeftComponent:(0,s.jsx)("div",{className:"flex grow items-center justify-between pr-5",children:(0,s.jsx)(z.dr,{children:Object.values(A.B).map(e=>(0,s.jsx)(z.SP,{value:e,onClick:()=>N(e),children:e},e))})}),dropDownValues:{created_bys:c,actives:[{label:"True",value:!0},{label:"False",value:!1}],evalTypes:u},filterButtonClasses:"justify-start",filterContainerClasses:"items-center !justify-between shrink-0",appliedFilterClasses:"!mx-[0px] mb-[12px]",isFullButton:!0,RightComponent:(0,s.jsxs)("div",{className:"grow shrink-0 flex items-center gap-[12px]",children:[(0,s.jsx)(Y.Z,{search:x,setSearch:j}),(0,s.jsxs)(I.z,{onClick:()=>{w(A.t.CREATION),D(p===A.B.OnlineEvals?A.B.OnlineEvals:A.B.OfflineEvals)},children:[(0,s.jsx)(f.pOD,{className:"w-3 h-3 mr-2"}),"New eval"]})]}),"data-sentry-element":"Filter","data-sentry-source-file":"EvalListFilter.tsx"})})},et=[{displayName:"Eval Type",key:"evalType",type:Q.vA.STRING,operators:[{isDefault:!0,operandCount:Q.W2.SINGLE,operandTypes:Q.vA.STRING,operatorName:"is",operatorDisplayName:"is"}]},{displayName:"Created At",key:"created_at",type:Q.vA.DATE_TIME,operators:[{isDefault:!0,operandCount:Q.W2.SINGLE,operandTypes:Q.vA.DATE_TIME,operatorName:"before",operatorDisplayName:"before"},{isDefault:!1,operandCount:Q.W2.SINGLE,operandTypes:Q.vA.DATE_TIME,operatorName:"after",operatorDisplayName:"after"}]},{displayName:"Updated At",key:"updated_at",type:Q.vA.DATE_TIME,operators:[{isDefault:!0,operandCount:Q.W2.SINGLE,operandTypes:Q.vA.DATE_TIME,operatorName:"before",operatorDisplayName:"before"},{isDefault:!1,operandCount:Q.W2.SINGLE,operandTypes:Q.vA.DATE_TIME,operatorName:"after",operatorDisplayName:"after"}]}],ea=[{displayName:"Active",key:"active",type:Q.vA.BOOLEAN,operators:[{isDefault:!0,operandCount:Q.W2.SINGLE,operandTypes:Q.vA.BOOLEAN,operatorName:"equals",operatorDisplayName:"equals"}]},...et],es=[{displayName:"Created By",key:"created_by",type:Q.vA.STRING,operators:[{isDefault:!0,operandCount:Q.W2.SINGLE,operandTypes:Q.vA.STRING,operatorName:"equals",operatorDisplayName:"equals"}]},...et];var el=a(22488);let en=()=>(0,s.jsxs)("div",{className:"flex items-start space-x-4 w-full animate-pulse","data-sentry-component":"LoadingPlaceholderRow","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)("div",{className:"w-4 h-4 bg-gray-200 rounded-sm"}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"h-5 bg-gray-200 rounded w-full"}),(0,s.jsx)("div",{className:"h-3 bg-gray-200 rounded w-full"})]}),(0,s.jsx)("div",{className:"w-20 h-5 bg-gray-200 rounded"}),(0,s.jsx)("div",{className:"w-16 h-5 bg-gray-200 rounded-full"}),(0,s.jsx)("div",{className:"w-24 h-4 bg-gray-200 rounded"}),(0,s.jsx)("div",{className:"w-16 h-4 bg-gray-200 rounded"}),(0,s.jsx)("div",{className:"w-5 h-5 bg-gray-200 rounded-full"}),(0,s.jsx)("div",{className:"w-24 h-4 bg-gray-200 rounded"}),(0,s.jsx)("div",{className:"w-8 h-5 bg-gray-200 rounded"})]}),er=()=>(0,s.jsx)("div",{className:"py-0 w-full h-full flex flex-col items-start","data-sentry-component":"EmptyCellRenderer","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsx)("span",{className:"text-[13px] font-normal text-zinc-400",children:"-"})}),ei=()=>(0,s.jsx)("div",{className:"py-0 w-full h-full flex flex-col items-start","data-sentry-component":"LoadingCellRenderer","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsx)(D.Z,{color:"#bbb",size:12,speedMultiplier:.5,"data-sentry-element":"ClipLoader","data-sentry-source-file":"EvalList.tsx"})}),eo=e=>{var t;let{score:a}=e;return(0,s.jsx)("div",{className:"py-0 w-full h-full flex flex-col items-start","data-sentry-component":"EvalScoreCellRenderer","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsx)("div",{className:"py-0 px-2 rounded-full ".concat(ep(null!=a?a:null)),children:(0,s.jsx)("span",{className:"text-[13px] font-medium",children:null!==(t=null==a?void 0:a.toFixed(3))&&void 0!==t?t:"-"})})})},ed=e=>{let{numPassed:t,numFailed:a}=e,l=t+a;return l>0?(0,s.jsxs)("div",{className:"px-2 pr-4 flex flex-row items-center gap-1",children:[(0,s.jsx)("div",{className:"py-0 px-2 rounded-full bg-gradient-to-r from-emerald-300 to-emerald-400",style:{width:"".concat(l>0?t/l*100:0),height:"6px"},children:"\xa0"}),(0,s.jsx)("div",{className:"py-0 px-2 rounded-full bg-gradient-to-r from-rose-300 to-rose-400",style:{width:"".concat(l>0?a/l*100:0),height:"6px"},children:"\xa0"})]}):(0,s.jsx)(er,{})},ec=e=>{let{data:t}=e;return(0,s.jsx)(C.h,{width:"100%",height:60,className:"py-0 pr-4","data-sentry-element":"ResponsiveContainer","data-sentry-component":"EvalPerDayChart","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsxs)(L.v,{data:t,className:"h-full border border-zinc-100 bg-gradient-to-br from-zinc-50 to-zinc-50/50 rounded-md",margin:{top:10,right:0,left:0,bottom:-20},"data-sentry-element":"BarChart","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)(k.u,{content:e=>{var t,a,l;let{active:n,payload:r}=e,i=null==r?void 0:null===(t=r[0])||void 0===t?void 0:t.payload;return(0,s.jsxs)("div",{className:"p-2 bg-white rounded-md shadow-sm",children:[(0,s.jsx)("h3",{className:"text-[13px] text-zinc-800 font-medium",children:null==i?void 0:i.date}),(0,s.jsxs)("p",{className:"text-[12px] text-zinc-700",children:["Avg score: ",null!==(l=null==i?void 0:null===(a=i.avgEvalScore)||void 0===a?void 0:a.toFixed(3))&&void 0!==l?l:"-"]}),(0,s.jsxs)("p",{className:"text-[12px] text-zinc-700",children:["# of runs: ",null==i?void 0:i.numValidEvals]})]})},contentStyle:{background:"white",border:"none",borderRadius:"4px"},cursor:{fill:"rgba(0, 0, 0, 0.05)"},"data-sentry-element":"Tooltip","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsx)(S.$,{dataKey:"numValidEvals",fill:"#ccc",isAnimationActive:!1,"data-sentry-element":"Bar","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsx)(_.K,{axisLine:!1,tickLine:!1,tick:!1,"data-sentry-element":"XAxis","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsx)(T.B,{axisLine:!1,tickLine:!1,tick:!1,"data-sentry-element":"YAxis","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsx)("defs",{"data-sentry-element":"defs","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsxs)("linearGradient",{id:"greyGradient",x1:"0",y1:"0",x2:"0",y2:"1","data-sentry-element":"linearGradient","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#4F46E5","data-sentry-element":"stop","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#818CF8","data-sentry-element":"stop","data-sentry-source-file":"EvalList.tsx"})]})})]})})},eu=e=>{let{column:t,label:a,currentSortColumn:l,currentSortDirection:n,onSort:r}=e;return(0,s.jsx)("th",{className:"font-light pb-2 cursor-pointer select-none",onClick:()=>r(t),"data-sentry-component":"SortableColumnHeader","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsxs)("div",{className:"flex items-center",children:[a,l===t&&(0,s.jsx)("span",{className:"ml-1",children:"asc"===n?(0,s.jsx)(h.Z,{size:14}):(0,s.jsx)(g.Z,{size:14})})]})})},ex=e=>{let{type:t,selectAllEvals:a,sortColumn:l,sortDirection:n,onSort:r}=e;return(0,s.jsx)("thead",{"data-sentry-component":"TableHeader","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsxs)("tr",{className:"text-left text-zinc-400 text-[13px]",children:[(0,s.jsx)("th",{className:"font-light pb-2 pl-2",children:(0,s.jsx)(F.X,{className:"w-4 h-4",onCheckedChange:a,"data-sentry-element":"Checkbox","data-sentry-source-file":"EvalList.tsx"})}),(0,s.jsx)(eu,{column:"display_name",label:"Title",currentSortColumn:l,currentSortDirection:n,onSort:r,"data-sentry-element":"SortableColumnHeader","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsx)("th",{className:"font-light pb-2 max-w-[120px]",children:"30 day chart"}),(0,s.jsx)(eu,{column:"metrics.avgScore",label:"Avg Score",currentSortColumn:l,currentSortDirection:n,onSort:r,"data-sentry-element":"SortableColumnHeader","data-sentry-source-file":"EvalList.tsx"}),t===A.B.OfflineEvals&&(0,s.jsx)("th",{className:"font-light pb-2",children:"Pass / Fail"}),(0,s.jsx)(eu,{column:"metrics.numRowsEvaluated",label:"30 Day Runs",currentSortColumn:l,currentSortDirection:n,onSort:r,"data-sentry-element":"SortableColumnHeader","data-sentry-source-file":"EvalList.tsx"}),t===A.B.OnlineEvals&&(0,s.jsx)(eu,{column:"active",label:"Online Status",currentSortColumn:l,currentSortDirection:n,onSort:r}),t===A.B.OfflineEvals&&(0,s.jsx)(eu,{column:"user.email",label:"Creator",currentSortColumn:l,currentSortDirection:n,onSort:r}),(0,s.jsx)(eu,{column:"updated_at",label:"Updated",currentSortColumn:l,currentSortDirection:n,onSort:r,"data-sentry-element":"SortableColumnHeader","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsx)("th",{className:"font-light pb-2"})]})})},ev=e=>{let{jobConfig:t,evalType:a,onDelete:l}=e,n=(0,E.useRouter)(),{setCurrentJobConfig:r,setCurrentModal:i}=(0,B.Z)(),o=()=>{"online"===a?n.push("/evals/online/".concat(t.id)):n.push("/evals/offline/".concat(t.id))},d=()=>{r({...t,display_name:"".concat(t.display_name," (copy)"),id:void 0}),i(A.t.CONFIGURE)},c=()=>{"offline"===a&&(r(t),i(A.t.RUN_EVAL))};return(0,s.jsxs)(y.h_,{"data-sentry-element":"DropdownMenu","data-sentry-component":"ThreeDotMenu","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)(y.$F,{className:"px-2 py-2 h-8 w-8 hover:bg-zinc-100 rounded-md focus:outline-none","data-sentry-element":"DropdownMenuTrigger","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsx)(f.nWS,{className:"cursor-pointer",color:"#a3a6a6","data-sentry-element":"DotsHorizontalIcon","data-sentry-source-file":"EvalList.tsx"})}),(0,s.jsxs)(y.AW,{className:"bg-white shadow flex flex-col gap-1 rounded-md",onClick:e=>e.stopPropagation(),"data-sentry-element":"DropdownMenuContent","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsxs)(y.Xi,{onClick:o,className:"flex flex-row items-center gap-2 text-[13px] px-2 py-1 text-zinc-700 border-b border-zinc-100 hover:bg-sky-50 focus:outline-none","data-sentry-element":"DropdownMenuItem","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)(f.kDh,{width:14,height:14,"data-sentry-element":"OpenInNewWindowIcon","data-sentry-source-file":"EvalList.tsx"})," ",(0,s.jsx)("span",{children:"Open"})]}),(0,s.jsx)(p.uP,{"data-sentry-element":"ContextMenuSeparator","data-sentry-source-file":"EvalList.tsx"}),(0,s.jsxs)(y.Xi,{onClick:d,className:"flex flex-row items-center gap-2 text-[13px] px-2 py-1 text-zinc-700 border-b border-zinc-100 hover:bg-sky-50 focus:outline-none","data-sentry-element":"DropdownMenuItem","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)(b.Z,{size:14,"data-sentry-element":"CopyIcon","data-sentry-source-file":"EvalList.tsx"})," ",(0,s.jsx)("span",{children:"Duplicate"})]}),(0,s.jsx)(p.uP,{"data-sentry-element":"ContextMenuSeparator","data-sentry-source-file":"EvalList.tsx"}),"offline"===a&&(0,s.jsxs)(y.Xi,{onClick:c,className:"flex flex-row items-center gap-2 text-[13px] px-2 py-1 text-zinc-700 border-b border-zinc-100 hover:bg-sky-50 focus:outline-none",children:[(0,s.jsx)(j.Z,{size:14})," ",(0,s.jsx)("span",{children:"Run"})]}),(0,s.jsxs)(y.Xi,{onClick:l,className:"flex flex-row items-center gap-2 text-[13px] px-2 py-1 text-zinc-700 border-b border-zinc-100 hover:bg-sky-50 focus:outline-none","data-sentry-element":"DropdownMenuItem","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)(N.Z,{size:14,"data-sentry-element":"Trash2Icon","data-sentry-source-file":"EvalList.tsx"})," ",(0,s.jsx)("span",{children:"Delete"})]})]})]})},em={"0-0.2":"border border-rose-100 bg-gradient-to-r to-rose-100 from-rose-100/70 text-rose-600","0.2-0.4":"border border-orange-100 bg-gradient-to-r to-orange-100 from-orange-100/70 text-orange-600","0.4-0.6":"border border-yellow-100 bg-gradient-to-r to-yellow-100 from-yellow-100/70 text-yellow-600","0.6-0.8":"border border-lime-100 bg-gradient-to-r to-lime-100 from-lime-100/70 text-lime-600","0.8-0.9":"border border-green-100 bg-gradient-to-r to-green-100 from-green-100/70 text-green-600","0.9-1.0":"border border-emerald-100 bg-gradient-to-r to-emerald-100 from-emerald-100/70 text-emerald-600"},ep=e=>null===e?"":e<=.2?em["0-0.2"]:e<=.4?em["0.2-0.4"]:e<=.6?em["0.4-0.6"]:e<=.79?em["0.6-0.8"]:e<=.9?em["0.8-0.9"]:em["0.9-1.0"],ey=e=>{let{title:t,description:a,maxLength:l=40}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-[13px] font-medium text-black",children:t}),a&&(0,s.jsx)("div",{className:"text-xs font-normal text-zinc-700",children:(0,O.$G)(a,l)})]})},ef=e=>{var t,a,l,n,r,i,o,d,c,u,x,v,m,p,y,f,h,g,b,j,N,w,D,C,L,k,S,_,T;let{evaluation:Z,isSelected:z,selectRow:M,loadingMetrics:A,onDelete:B}=e,I=(0,E.useRouter)();return Z?(0,s.jsxs)("tr",{className:"px-2 border-t border-zinc-200/70 hover:bg-zinc-50 cursor-pointer group ".concat(z?"bg-sky-50":""),onClick:()=>{I.push("/evals/offline/".concat(Z.id))},"data-sentry-component":"OfflineEvalRow","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)("td",{className:"pl-2 py-6",children:(0,s.jsx)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",style:{opacity:z?1:void 0},children:(0,s.jsx)(F.X,{checked:z,onClick:e=>{e.stopPropagation()},onCheckedChange:()=>{M(Z.id)},"data-sentry-element":"Checkbox","data-sentry-source-file":"EvalList.tsx"})})}),(0,s.jsx)("td",{className:"max-w-[200px]",children:(0,s.jsx)(ey,{title:null!==(D=null!==(w=null!==(N=Z.display_name)&&void 0!==N?N:null===(t=Z.eval_type)||void 0===t?void 0:t.label)&&void 0!==w?w:null===(a=Z.eval_type)||void 0===a?void 0:a.id)&&void 0!==D?D:"Unknown",description:null===(l=Z.eval_type)||void 0===l?void 0:l.description,maxLength:40,"data-sentry-element":"EvalTitleAndDescription","data-sentry-source-file":"EvalList.tsx"})}),(0,s.jsx)("td",{className:"min-w-[120px] max-w-[120px]",children:(null===(n=Z.metrics)||void 0===n?void 0:null===(r=n.perDayData)||void 0===r?void 0:r.length)&&(null===(i=Z.metrics)||void 0===i?void 0:null===(o=i.perDayData)||void 0===o?void 0:o.find(e=>e.numValidEvals>0))?(0,s.jsx)(ec,{data:null!==(C=null===(d=Z.metrics)||void 0===d?void 0:d.perDayData)&&void 0!==C?C:[]}):A?(0,s.jsx)(ei,{}):(0,s.jsx)(er,{})}),(0,s.jsx)("td",{className:"py-2",children:A?(0,s.jsx)(ei,{}):(null===(c=Z.metrics)||void 0===c?void 0:c.avgScore)!=void 0?(0,s.jsx)(eo,{score:null!==(L=null===(u=Z.metrics)||void 0===u?void 0:u.avgScore)&&void 0!==L?L:null}):(0,s.jsx)(er,{})}),(0,s.jsx)("td",{className:"text-xs font-normal text-zinc-700",children:A?(0,s.jsx)(ei,{}):(null===(x=Z.metrics)||void 0===x?void 0:x.passFailDistribution)!=void 0&&((null===(v=Z.metrics)||void 0===v?void 0:v.passFailDistribution.passed)!=0||(null===(m=Z.metrics)||void 0===m?void 0:m.passFailDistribution.failed)!=0)?(0,s.jsx)(ed,{numPassed:null!==(k=null===(p=Z.metrics)||void 0===p?void 0:null===(y=p.passFailDistribution)||void 0===y?void 0:y.passed)&&void 0!==k?k:0,numFailed:null!==(S=null===(f=Z.metrics)||void 0===f?void 0:null===(h=f.passFailDistribution)||void 0===h?void 0:h.failed)&&void 0!==S?S:0}):(0,s.jsx)(er,{})}),(0,s.jsx)("td",{className:"text-xs font-normal text-zinc-700",children:null!==(_=null===(g=Z.metrics)||void 0===g?void 0:g.numRowsEvaluated)&&void 0!==_?_:(0,s.jsx)(er,{})}),(0,s.jsx)("td",{className:"text-xs font-normal text-zinc-700",children:(null===(b=Z.user)||void 0===b?void 0:b.email)?(0,s.jsx)(R.ce,{text:null!==(T=null===(j=Z.user)||void 0===j?void 0:j.email)&&void 0!==T?T:"",onClick:()=>{}}):(0,s.jsx)(er,{})}),(0,s.jsx)("td",{className:"text-xs font-normal text-zinc-700",children:Z.updated_at?(0,O.o0)(Z.updated_at):"-"}),(0,s.jsx)("td",{className:"",children:(0,s.jsx)(ev,{jobConfig:Z,evalType:"offline",onDelete:B,"data-sentry-element":"ThreeDotMenu","data-sentry-source-file":"EvalList.tsx"})})]}):null},eh=e=>{var t,a,l,n,r,i,o,d,c,u,x,v,m,p,y,f,h,g;let{evaluation:b,isSelected:j,selectRow:N,loadingMetrics:w,onDelete:D}=e,C=(0,E.useRouter)();return b?(0,s.jsxs)("tr",{className:"px-2 border-t hover:bg-zinc-50 cursor-pointer group ".concat(j?"bg-sky-50":""),onClick:()=>{C.push("/evals/online/".concat(b.id))},"data-sentry-component":"OnlineEvalRow","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)("td",{className:"pl-2 py-4",onClick:e=>{e.stopPropagation(),N(b.id)},children:(0,s.jsx)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",style:{opacity:j?1:void 0},children:(0,s.jsx)(F.X,{className:"w-4 h-4",checked:j,"data-sentry-element":"Checkbox","data-sentry-source-file":"EvalList.tsx"})})}),(0,s.jsx)("td",{className:"py-4 max-w-[300px]",children:(0,s.jsx)(ey,{title:null!==(y=null!==(p=null!==(m=b.display_name)&&void 0!==m?m:null===(t=b.eval_type)||void 0===t?void 0:t.label)&&void 0!==p?p:null===(a=b.eval_type)||void 0===a?void 0:a.id)&&void 0!==y?y:"Unknown",description:null===(l=b.eval_type)||void 0===l?void 0:l.description,maxLength:60,"data-sentry-element":"EvalTitleAndDescription","data-sentry-source-file":"EvalList.tsx"})}),(0,s.jsx)("td",{className:"py-4 max-w-[120px]",children:(null===(n=b.metrics)||void 0===n?void 0:null===(r=n.perDayData)||void 0===r?void 0:r.length)&&(null===(i=b.metrics)||void 0===i?void 0:null===(o=i.perDayData)||void 0===o?void 0:o.find(e=>e.numValidEvals>0))&&(0,s.jsx)(ec,{data:null!==(f=null===(d=b.metrics)||void 0===d?void 0:d.perDayData)&&void 0!==f?f:[]})}),(0,s.jsx)("td",{className:"py-4",children:w?(0,s.jsx)(ei,{}):(null===(c=b.metrics)||void 0===c?void 0:c.avgScore)!=void 0?(0,s.jsx)(eo,{score:null!==(h=null===(u=b.metrics)||void 0===u?void 0:u.avgScore)&&void 0!==h?h:null}):(0,s.jsx)(er,{})}),(0,s.jsx)("td",{className:"py-4 text-xs font-normal text-zinc-700",children:w?(0,s.jsx)(ei,{}):(null===(x=b.metrics)||void 0===x?void 0:x.numRowsEvaluated)!=void 0?null!==(g=null===(v=b.metrics)||void 0===v?void 0:v.numRowsEvaluated)&&void 0!==g?g:"-":(0,s.jsx)(er,{})}),(0,s.jsx)("td",{className:"py-4 text-xs font-normal text-zinc-700",children:(null==b?void 0:b.active)?(0,s.jsx)(el.Z,{active:!0}):(0,s.jsx)(el.Z,{active:!1})}),(0,s.jsx)("td",{className:"py-4 text-xs font-normal text-zinc-700",children:b.updated_at?(0,O.o0)(b.updated_at):"-"}),(0,s.jsx)("td",{className:"py-4",children:(0,s.jsx)(ev,{evalType:"online",onDelete:D,jobConfig:b,"data-sentry-element":"ThreeDotMenu","data-sentry-source-file":"EvalList.tsx"})})]}):null},eg=e=>{var t,a,l;let{offlineEvals:r,onlineEvals:i,offlineEvalsLoading:o,onlineEvalsLoading:d,offlineEvalsWithMetricsLoading:c,onlineEvalsWithMetricsLoading:u,onDeleteEvals:x}=e,[v,m]=(0,n.useState)([]),p=e=>{v.includes(e)?m(v.filter(t=>t!==e)):m([...v,e])},[y,h]=(0,n.useState)(!1),{filters:g}=(0,M.Z)(),b=(0,E.useRouter)(),j=null!==(t=b.query.tab)&&void 0!==t?t:A.B.OnlineEvals,w=j===A.B.OnlineEvals?i:r,D=JSON.parse(null!==(a=g.tableFilters)&&void 0!==a?a:"[]"),C=null!==(l=b.query.search)&&void 0!==l?l:"",L=w.filter(e=>{if(C){var t,a,s,l,n;let r=C.toLowerCase();return(null===(t=e.display_name)||void 0===t?void 0:t.toLowerCase().includes(r))||(null===(a=e.eval_type)||void 0===a?void 0:null===(s=a.label)||void 0===s?void 0:s.toLowerCase().includes(r))||(null===(l=e.user)||void 0===l?void 0:null===(n=l.email)||void 0===n?void 0:n.toLowerCase().includes(r))}return D.every(t=>{var a,s;return"active"===t.key?e.active===t.value:"created_by"===t.key?(null===(a=e.user)||void 0===a?void 0:a.id)===t.value:"evalType"===t.key?(null===(s=e.eval_type)||void 0===s?void 0:s.id)===t.value:"created_at"===t.key&&"before"===t.operator?new Date(e.created_at)<new Date(t.value):"created_at"===t.key&&"after"===t.operator?new Date(e.created_at)>new Date(t.value):"updated_at"===t.key&&"before"===t.operator?new Date(e.updated_at)<new Date(t.value):"updated_at"!==t.key||"after"!==t.operator||new Date(e.updated_at)>new Date(t.value)})}),k=j===A.B.OnlineEvals?d:o,S=()=>{h(!0)},_=()=>{h(!1),m([])},T=[{label:j===A.B.OnlineEvals?"Archive":"Delete",icon:j===A.B.OnlineEvals?(0,s.jsx)(f.rKT,{className:"w-3 h-3"}):(0,s.jsx)(N.Z,{className:"w-3 h-3"}),onClick:S,variant:"outline"}],[B,O]=(0,n.useState)("updated_at"),[I,F]=(0,n.useState)("desc"),R=e=>{B===e?F("asc"===I?"desc":"asc"):(O(e),F("asc"))},q=(0,n.useMemo)(()=>[...L].sort((e,t)=>{var a,s,l,n;if(!B)return 0;let r=e[B],i=t[B];return("metrics.avgScore"===B?(r=null===(a=e.metrics)||void 0===a?void 0:a.avgScore,i=null===(s=t.metrics)||void 0===s?void 0:s.avgScore):"metrics.numRowsEvaluated"===B&&(r=null===(l=e.metrics)||void 0===l?void 0:l.numRowsEvaluated,i=null===(n=t.metrics)||void 0===n?void 0:n.numRowsEvaluated),r<i)?"asc"===I?-1:1:r>i?"asc"===I?1:-1:0}),[L,B,I]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"py-3 px-6 bg-white",children:[(0,s.jsx)(z.mQ,{value:j,className:"w-full","data-sentry-element":"Tabs","data-sentry-source-file":"EvalList.tsx",children:(0,s.jsx)(ee,{"data-sentry-element":"EvalListFilter","data-sentry-source-file":"EvalList.tsx"})}),k?(0,s.jsxs)("div",{className:"flex flex-col gap-10 mt-4",children:[(0,s.jsx)(en,{}),(0,s.jsx)(en,{}),(0,s.jsx)(en,{}),(0,s.jsx)(en,{}),(0,s.jsx)(en,{})]}):w.length?(0,s.jsxs)("table",{className:"w-full",children:[(0,s.jsx)(ex,{type:j,selectAllEvals:e=>{m(e?q.map(e=>e.id):[])},sortColumn:B,sortDirection:I,onSort:R}),(0,s.jsx)("tbody",{className:"w-full",children:0===q.length&&w.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:8,children:(0,s.jsx)(ej,{})})}):q.map((e,t)=>j===A.B.OnlineEvals?(0,s.jsx)(eh,{evaluation:e,isSelected:v.includes(e.id),selectRow:p,loadingMetrics:u,onDelete:()=>{h(!0),m([e.id])}},t):(0,s.jsx)(ef,{evaluation:e,isSelected:v.includes(e.id),selectRow:p,loadingMetrics:c,onDelete:()=>{h(!0),m([e.id])}},t))})]}):(0,s.jsx)(eb,{})]}),(0,s.jsx)(Z.Z,{selectedCount:v.length,onDeselect:()=>m([]),actions:T,"data-sentry-element":"ListBottomBar","data-sentry-source-file":"EvalList.tsx"}),y&&(0,s.jsx)(U,{evalConfigIds:v,closeModal:_,isOnline:j===A.B.OnlineEvals,onDeleteComplete:()=>x(v)})]})},eb=()=>{let{setCurrentModal:e}=(0,B.Z)(),t=()=>{e(A.t.CREATION)},a=(0,E.useRouter)(),l=()=>{a.push({query:{saveType:"preset-evals"}})};return(0,s.jsxs)("div",{className:"flex flex-col gap-4 items-center justify-center h-[300px]","data-sentry-component":"OnlineEvalsEmptyState","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)("div",{className:"h-8 w-8 rounded bg-zinc-100 flex items-center justify-center",children:(0,s.jsx)(f.YGl,{className:"text-zinc-500","data-sentry-element":"LightningBoltIcon","data-sentry-source-file":"EvalList.tsx"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-1 justify-center items-center",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-zinc-700",children:"Configure and run evaluations on your logs"}),(0,s.jsxs)("div",{className:"text-[13px] font-normal text-zinc-500 w-[400px] text-center",children:["Use online evals to run on your inference logs automatically and continuously."," ",(0,s.jsx)("a",{className:"text-blue-500 hover:text-blue-600 font-medium",href:"https://docs.athina.ai/evals/automatic-evals",children:"Learn more"})]})]}),(0,s.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,s.jsx)(I.z,{variant:"outline",onClick:l,"data-sentry-element":"Button","data-sentry-source-file":"EvalList.tsx",children:"Browse preset evals"}),(0,s.jsxs)(I.z,{className:"flex gap-[5px]",onClick:t,"data-sentry-element":"Button","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)(w.Z,{className:"w-3 h-3","data-sentry-element":"PlusIcon","data-sentry-source-file":"EvalList.tsx"}),"New online eval"]})]})]})},ej=()=>(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center bg-white border-t border-zinc-200 h-[300px]","data-sentry-component":"FilterEmptyState","data-sentry-source-file":"EvalList.tsx",children:[(0,s.jsx)("div",{className:"text-[14px] font-medium text-zinc-700 w-full text-center",children:"No evals found"}),(0,s.jsx)("div",{className:"text-[13px] font-normal text-zinc-500 mt-2",children:"Try changing the search item or filters"})]});var eN=a(30431),ew=a(71129);let eE=()=>{var e,t,a,l,p;let y=(0,r.useQueryClient)(),f=new Date().toISOString(),h=new Date(new Date().setDate(new Date().getDate()-30)).toISOString(),{data:g,isLoading:b,refetch:j}=(0,i.Z)({includeMetrics:!1}),{data:N,isLoading:w,refetch:D}=(0,i.Z)({includeMetrics:!0,startTime:h,endTime:f}),{data:C,isLoading:L}=(0,o.Z)({includeMetrics:!1}),{data:k,isLoading:S}=(0,o.Z)({includeMetrics:!0}),{user:_}=(0,c.s6)(),{toast:T,showToast:Z,closeToast:z}=(0,d.Z)(),M=null!==(e=N||g)&&void 0!==e?e:{offline_evals:[]},A=[...null!==(t=null==M?void 0:M.offline_evals)&&void 0!==t?t:[]],B=null!==(a=k||C)&&void 0!==a?a:{online_evals:[]},O=[...null!==(l=null==B?void 0:B.online_evals)&&void 0!==l?l:[]],I=(0,n.useCallback)(e=>{y.setQueryData([u.Z.GET_OFFLINE_EVALS,"true"],t=>t?{...t,offline_evals:t.offline_evals.filter(t=>!e.includes(t.id))}:t),y.setQueryData([u.Z.GET_ONLINE_EVALS,!0],t=>t?{...t,online_evals:t.online_evals.filter(t=>!e.includes(t.id))}:t)},[y]),F=(0,E.useRouter)(),R=null!==(p=F.query.saveType)&&void 0!==p?p:"saved-evals";return(0,s.jsxs)("div",{className:"w-[calc(100vw-50px)] my-[32px]","data-sentry-component":"EvalV2","data-sentry-source-file":"evalV2.tsx",children:[(0,s.jsx)("div",{className:"flex flex-row justify-between items-center px-6",children:(0,s.jsx)(x.Z,{items:[{label:"Evals",url:"/evals"},{label:"All",url:"#"}],"data-sentry-element":"Breadcrumbs","data-sentry-source-file":"evalV2.tsx"})}),(0,s.jsx)("div",{className:"mt-2"}),(0,s.jsx)(m.Z,{value:R,onValueChange:e=>{F.push({query:{saveType:e}})},tabs:[{value:"saved-evals",label:"Saved evals",content:(0,s.jsx)(eg,{offlineEvals:A,onlineEvals:O,offlineEvalsLoading:b,onlineEvalsLoading:L,offlineEvalsWithMetricsLoading:w,onlineEvalsWithMetricsLoading:S,onDeleteEvals:I})},{value:"preset-evals",label:"Preset evals",content:(0,s.jsx)(ew.Z,{})}],tabHeaderClasses:"flex justify-between items-center w-full","data-sentry-element":"SimpleTabBar","data-sentry-source-file":"evalV2.tsx"}),(0,s.jsx)(eN.Z,{"data-sentry-element":"EvalSelectionModal","data-sentry-source-file":"evalV2.tsx"}),T&&(0,s.jsx)("div",{children:(0,s.jsx)(v.Z,{message:T.message,submessage:T.submessage,type:T.type,onClose:z,classes:"fixed left-1/2 -translate-x-1/2 top-2 bottom-[unset] right-[unset]"})})]})},eD=()=>(0,s.jsx)(l.Z,{"data-sentry-element":"BaseDashboard","data-sentry-component":"EvalDashboard","data-sentry-source-file":"index.tsx",children:(0,s.jsx)(eE,{"data-sentry-element":"EvalV2","data-sentry-source-file":"index.tsx"})});var eC=eD},1783:function(e,t,a){"use strict";a.d(t,{E:function(){return d}});var s=a(88767),l=a(16546),n=a(48830),r=a(25072),i=a(40921);let o="api/v1/dataset_v2/all",d=async e=>{let t=(0,n.SE)({name:e,page:0}),a="".concat((0,l.JW)(),"/").concat(o,"/?").concat(t),{data:s}=await i.Z.get(a);return s.data},c=e=>{let{name:t,page:a}=e,d=(0,n.SE)({name:t,page:a}),c="".concat((0,l.JW)(),"/").concat(o,"/?").concat(d);return(0,s.useQuery)({queryKey:[r.Z.GET_ALL_DATASETS,d],queryFn:async()=>{let{data:e}=await i.Z.get(c);return e},refetchOnWindowFocus:!1})};t.Z=c},18305:function(e,t,a){"use strict";a.d(t,{G:function(){return r}});var s=a(88767),l=a(16546),n=a(40921);let r=()=>(0,s.useQuery)("getOrgUsers",async()=>{var e;let{data:t}=await n.Z.get("".concat((0,l.JW)(),"/api/v1/org/users"));return null!==(e=null==t?void 0:t.data)&&void 0!==e?e:[]},{retry:!1})},79317:function(e,t,a){"use strict";a.d(t,{p:function(){return s}});let s={v1:"api/v1",v2:"api/v2"};t.Z={featureGuide:"api/v1/feature_guide",ide_experiment:"api/v1/ide_experiment",annotations:"api/v1/annotation",datasetV2:"dataset_v2",tag:"tag",appBuilder:"app-builder",datasetFolder:"dataset_folder"}}},function(e){e.O(0,[3662,1086,5244,8708,6169,1166,8676,2811,1883,4363,7632,8422,8523,7597,3560,7030,4417,8028,1145,3215,9774,2888,179],function(){return e(e.s=51782)}),_N_E=e.O()}]);