import{_ as U,gC as z,jA as H,u as K,b9 as O,bg as Y,jn as B,ek as W,t as X,A as y,he as Z,p as ee,az as se,hf as te,hh as F,bK as T,bL as ae,U as w,r as g,q as h,g1 as re,o as ie,cR as ne,fJ as oe,e as ce,fa as le,es as $,aJ as de,gf as pe,eC as he,bP as ue,j as s,D as fe,$ as P,ap as k,C as A,bd as E,h as me,bF as S}from"./index-46ma1THH.js";import{P as ge}from"./Panel-CnxQ3Lqy.js";var xe=U(function(t,e){return z(H(t),e)});const _=te(ue.DATE_TIME.DATE),ve=()=>{var C,D;const{id:n,fsId:t,fvName:e,fvVersion:a,tdVersion:i}=K(),o=O(),{pathname:u}=Y(),{currentData:c={items:[]}}=B({pId:+n,fsId:+t,id:e}),{currentData:x,isFetching:f,refetch:m}=W({pId:+n,fsId:+t,id:e,version:+a,params:{expand:["features"]}}),{currentData:d={items:[]},refetch:p}=X({pId:+n,fsId:+t,id:e,version:+a}),Q=d.items.find(y("version",+i)),{currentData:r,isFetching:R}=Z({pId:+n,fsId:+t,fvName:e,fvVersion:+a,id:+i,params:{fields:"content"}},{skip:xe(y("version",+i),d.items)}),G=ee(T(ae(w("version"))),se(({version:l,eventStartTime:V,eventEndTime:v})=>({value:`${l}`,label:`${l} (${_(F(V))} -> ${_(F(v))})`})))(d.items),L=g.useCallback(l=>{o(h.project.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:l,tdVersion:+i})},[t,e,o,i]),q=g.useCallback(l=>{const V=[h.project.featureView.td.statistics,h.project.featureView.td.correlation].find(v=>re(ie(v,h.project.value),u))??h.project.featureView.td.statistics;o(V,{fsId:t,fvName:e,fvVersion:+a,tdVersion:+l})},[t,e,a,o,u]),[b,J]=ne("split"),I=r!=null&&r.entities?[]:T(oe(ce),le(r)),j=r!=null&&r.entities?r.entities.statistics:(D=(C=w(b??$(I),r))==null?void 0:C.entities)==null?void 0:D.statistics,M=g.useMemo(()=>de(pe(he,["extendedStatistics","correlations"]),j??{}),[j]),N=g.useCallback(()=>{m(),p()},[p,m]);return{allFvs:c,correlations:M,fv:x,fvName:e,fvVersion:a,handleTdVersionChange:q,handleVersionChange:L,isFetching:f||R,refetchAllData:N,statistics:j,splitNames:I,setSplit:J,split:b,tdVersion:i,tdVersionOptions:G,trainingDataset:Q}},be=({isFetching:n,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:i,handleTdVersionChange:o,refetchAllData:u,splitNames:c,setSplit:x,split:f,tdVersion:m,tdVersionOptions:d})=>s.jsxs(s.Fragment,{children:[n&&s.jsx(fe,{}),s.jsx(ge,{title:t,versions:(a==null?void 0:a.items)??[{version:+e}],version:+e,onVersionChange:i,idColor:"labels.purple",onClickRefresh:u,children:s.jsxs(P,{alignItems:"center",ml:"2px",children:[s.jsx(k,{icon:A.arrow_right,color:"grayShade1"}),s.jsx(E,{width:"216px",value:m,options:d,placeholder:"version",onChange:o}),!me(c)&&s.jsxs(s.Fragment,{children:[s.jsx(k,{icon:A.arrow_right,color:"grayShade1"}),c.length>1?s.jsx(E,{width:"140px",value:f||$(c),options:c.map(p=>({value:p,label:p})).reverse(),placeholder:"split",onChange:x}):s.jsxs(P,{alignItems:"flex-end",children:[s.jsx(S,{ml:"5px",color:"gray",children:"split"}),s.jsx(S,{mx:"5px",children:f})]})]})]})})]});export{be as T,ve as u};
