1import{q as A,aA as F,r as o,j as e,a$ as B,bm as b,B as g,C as i,H,I as R,aP as y,aL as L,S as I,a5 as C,v as P,aV as $,aW as M,aX as n,aT as O,aU as r,K as _,x as U}from"./root-Bfop0rm5.js";import{u as T}from"./useSuspenseQuery-BQhhhUjQ.js";import{g as Q}from"./RouterProvider-BbsgWugL.js";import{e as q,f as G,g as K,h as V,H as W}from"./index-C97ZXgRl.js";import{D as X}from"./DeleteModal-BDcs4Kbs.js";import{f as Y}from"./format-DUiBe8lm.js";import"./queryOptions-BQvTFV_-.js";import"./useMutation-DrGfYVG5.js";import"./hooks-BJhLWX9Q.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"distillery-frontend"};var l=new a.Error().stack;l&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[l]="c0e8a072-8d4f-4985-9c47-09543925abe1",a._sentryDebugIdIdentifier="sentry-dbid-c0e8a072-8d4f-4985-9c47-09543925abe1")}catch{}})();const m=Q("/management/benchmarking/initiatives/$initiativeId"),re=()=>{const a=A(),l=F(),d=m.useLoaderDeps(),u=m.useNavigate(),x=m.useParams(),{data:s}=T(q(x)),{data:c}=T(G({...x,...d})),h=K(),N=V(),[w,p]=o.useState(),[j,D]=o.useState(s.name),[v,S]=o.useState(s.hypothesis),[f,k]=o.useState(s.results),E=t=>{t.preventDefault(),h.mutate({initiativeId:s.id,name:j,hypothesis:v,results:f},{onSuccess:()=>{a.success("Saved initiative."),u({to:"/management/benchmarking/initiatives/$initiativeId/",params:{initiativeId:s.id}})},onError:()=>{a.error("Failed to save initiative.")}})};return e.jsxs(e.Fragment,{children:[e.jsx(W,{children:e.jsx("title",{children:"Benchmarking | SearchPilot"})}),e.jsxs(B,{children:[e.jsx(b,{label:"Benchmarking Initiatives",href:l.buildLocation({to:"/management/benchmarking/initiatives/"}).href}),e.jsx(b,{label:`Initiative: ${s.name}`,href:"",currentCrumb:!0})]}),e.jsx("main",{className:"ml-auto w-full grow",children:e.jsxs("div",{className:"mx-auto mt-4 max-w-7xl px-12",children:[e.jsx("form",{onSubmit:E,children:e.jsxs(g,{children:[e.jsx(i,{children:e.jsx(i.Content,{children:e.jsx(i.Title,{children:"Initiative"})})}
1),e.jsxs(H,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(R,{label:"Name",onChangeFunction:D,value:j,required:!0})}),e.jsx("div",{className:"mb-4",children:e.jsx(y,{id:"hypothesis",label:"Hypothesis",onChangeFunction:S,onChangeParameters:[],value:v})}),e.jsx("div",{className:"mb-4",children:e.jsx(y,{id:"results",label:"Results",onChangeFunction:k,onChangeParameters:[],value:f})})]}),e.jsx(L,{classes:"flex justify-end mr-2",children:e.jsx(I,{variant:"primary",loading:h.isPending,type:"submit",children:"Update Initiative"})})]})}),e.jsxs(g,{children:[e.jsxs(i,{children:[e.jsx(i.Content,{children:e.jsx(i.Title,{children:"Trials"})}),e.jsx(C,{to:"/management/benchmarking/initiatives/$initiativeId/trials/add/",params:{initiativeId:s.id},children:e.jsx(I,{leftIcon:e.jsx(P,{color:"white",hoverColor:void 0,name:"plus"}),variant:"primary",children:"Add New Trial"})})]}),e.jsxs($,{children:[e.jsx("thead",{children:e.jsxs(M,{children:[e.jsx(n,{className:"w-4/12",children:"Name"}),e.jsx(n,{className:"w-3/12 text-center",children:"Created At"}),e.jsx(n,{className:"w-1/12 text-center",children:"Iterations"}),e.jsx(n,{className:"w-1/12 text-center",children:"Number of Experiments"}),e.jsx(n,{className:"w-1/12 text-center",children:"Number of Evaluations"}),e.jsx(n,{className:"w-2/12 text-center",children:"Actions"})]})}),e.jsx("tbody",{children:c.results.map(t=>e.jsxs(O,{children:[e.jsx(r,{extraClasses:"align-middle",children:e.jsx(C,{to:"/management/benchmarking/initiatives/$initiativeId/trials/$trialId/",params:{initiativeId:s.id,trialId:t.id},children:t.name})}),e.jsx(r,{extraClasses:"text-center",children:Y(t.createdAt,"eee do MMM yyyy hh:mm aaaa")}),e.jsx(r,{extraClasses:"text-center",children:t.iterations}),e.jsx(r,{extraClasses:"text-center",children:t.numExperimentDataFiles}),e.jsx(r,{extraClasses:"text-center",children:t.numEvaluations}),e.jsx(r,{extraClasses:"flex align-middle",children:e.jsxs("div",{className:"mx-auto flex items-center",children:[e.jsx(X,{open:w===t.id,headerText:"Delete Trial",bodyText:`Are you sure you want to delete trial: ${t.name}?`,onSubmit:()=>{N.mutate({trialId:t.id},{onSuccess:()=>{a.success("Deleted trial."),l.invalidate()},onError:()=>{a.error("Failed to delete trial.")}})},onClose:()=>p(void 0)}),e.jsx(_.Outline,{iconName:"trashCan",onClick:()=>{p(t.id)},tooltipPosition:"top",tooltipText:"Delete Trial",variant:"primary"})]})})]},t.id))})]}),e.jsx("div",{className:"border-t border-gray-200 px-4 py-4",children:e.jsx(U,{totalCount:c.count,listItems:c.results,setOffset:t=>u({search:{page:t/15+1}}),setLimit:()=>{},offset:d.offset,limit:15,options:[15],allOption:!1})})]})]})})]})};export{re as default}; 2//# sourceMappingURL=BenchmarkingInitiativeDetailApp-9vn4Nkt-.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.