import{_ as q,jf as J,jg as H,gV as O,bR as z,u as K,bJ as W,bi as X,j0 as Y,e1 as Z,v as ee,D as C,hc as se,f as te,aB as ae,he as T,bM as w,bN as ie,U as F,r as g,s as h,g7 as ne,q as re,cL as oe,gU as ce,fJ as le,m as de,eS as ue,e9 as G,aN as he,gm as pe,ej as me,j as s,L as fe,B as P,au as S,C as E,be as k,h as ge,bG as _}from"./index-C1DmWO_C.js";import{P as xe}from"./Panel-Z-sMb6LN.js";var je=q(function(t,e){return J(H(t),e)});const A=O(z.DATE_TIME.DATE),be=()=>{var D,y;const{id:r,fsId:t,fvName:e,fvVersion:a,tdVersion:n}=K(),o=W(),{pathname:p}=X(),{currentData:c={items:[]}}=Y({pId:+r,fsId:+t,id:e}),{currentData:x,isFetching:m,refetch:f}=Z({pId:+r,fsId:+t,id:e,version:+a,params:{expand:["features"]}}),{currentData:d={items:[]},refetch:u}=ee({pId:+r,fsId:+t,id:e,version:+a}),L=d.items.find(C("version",+n)),{currentData:i,isFetching:Q}=se({pId:+r,fsId:+t,fvName:e,fvVersion:+a,id:+n,params:{fields:"content"}},{skip:je(C("version",+n),d.items)}),N=te(w(ie(F("version"))),ae(({version:l,eventStartTime:V,eventEndTime:v})=>({value:`${l}`,label:`${l} (${A(T(V))} -> ${A(T(v))})`})))(d.items),R=g.useCallback(l=>{o(h.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:l,tdVersion:+n})},[t,e,o,n]),$=g.useCallback(l=>{const V=[h.featureView.td.statistics,h.featureView.td.correlation].find(v=>ne(re(v,h.project.value),p))??h.featureView.td.statistics;o(V,{fsId:t,fvName:e,fvVersion:+a,tdVersion:+l})},[t,e,a,o,p]),[b,B]=oe("split",ce),I=i!=null&&i.entities?[]:w(le(de),ue(i)),j=i!=null&&i.entities?i.entities.statistics:(y=(D=F(b??G(I),i))==null?void 0:D.entities)==null?void 0:y.statistics,M=g.useMemo(()=>he(pe(me,["extendedStatistics","correlations"]),j??{}),[j]),U=g.useCallback(()=>{f(),u()},[u,f]);return{allFvs:c,correlations:M,fv:x,fvName:e,fvVersion:a,handleTdVersionChange:$,handleVersionChange:R,isFetching:m||Q,refetchAllData:U,statistics:j,splitNames:I,setSplit:B,split:b,tdVersion:n,tdVersionOptions:N,trainingDataset:L}},Ie=({isFetching:r,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:n,handleTdVersionChange:o,refetchAllData:p,splitNames:c,setSplit:x,split:m,tdVersion:f,tdVersionOptions:d})=>s.jsxs(s.Fragment,{children:[r&&s.jsx(fe,{}),s.jsx(xe,{title:t,versions:(a==null?void 0:a.items)??[{version:+e}],version:+e,onVersionChange:n,idColor:"labels.purple",onClickRefresh:p,children:s.jsxs(P,{alignItems:"center",ml:"2px",children:[s.jsx(S,{icon:E.arrow_right,color:"grayShade1"}),s.jsx(k,{width:"216px",value:f,options:d,placeholder:"version",onChange:o}),!ge(c)&&s.jsxs(s.Fragment,{children:[s.jsx(S,{icon:E.arrow_right,color:"grayShade1"}),c.length>1?s.jsx(k,{width:"140px",value:m||G(c),options:c.map(u=>({value:u,label:u})).reverse(),placeholder:"split",onChange:x}):s.jsxs(P,{alignItems:"flex-end",children:[s.jsx(_,{ml:"5px",color:"gray",children:"split"}),s.jsx(_,{mx:"5px",children:m})]})]})]})})]});export{Ie as T,be as u};
