import{u as E,bK as l,s as u,bp as L,bI as N,r as m,q as G,aN as V,gm as y,ej as P,bx as k,by as w,j as i,cr as R,L as j,h as $,dX as q}from"./index-C1DmWO_C.js";import{P as H}from"./Panel-Z-sMb6LN.js";import{N as K}from"./NoData-Y_e6mfNf.js";import{C as M}from"./Correlation-C82g4uAe.js";import{u as O}from"./useUserPermissions-BiARnwL4.js";import{u as U}from"./useFeatureGroupView-BP_FibV0.js";import{u as X}from"./useFeatureGroupVersions-BgrH6YdJ.js";import"./Deprecated-BQWZLUTP.js";import"./Project-CpwJZ-CK.js";import"./alertManagerConfig.selectors-B9ELaxCY.js";import"./index-Dub34MAX.js";import"./FileUploaderButton-BtxUzlTS.js";import"./zipObj-D8EtfWld.js";import"./useScreenWithScroll-zcr7TMGO.js";import"./symmetricDifference-B3GPGppJ.js";import"./git-C8OLuEaG.js";import"./useCopyToClipboard-v9FBn9Nz.js";import"./Anchor-DFXOcnPw.js";import"./transform-C0Urpblx.js";import"./string-CFFdVFMV.js";import"./linear-DWGfDWoG.js";import"./utils-DospTenN.js";import"./storage-connector-BuEuJyVA.js";import"./project-VxxpMOY0.js";const gt=()=>{const{id:e,fsId:r,fgId:o,computationTime:a}=E(),d=l(s=>{var c;return(c=s.featureGroupStatistics)==null?void 0:c.entities.statistics}),g=l(s=>s.loading.effects.featureGroupStatistics.fetch),C=l(s=>s.featureGroupStatisticsCommits),{isLoading:h,data:t}=U(+e,+o,+r),{currentData:I=[t],isFetching:x,handleVersionChange:b}=X(t==null?void 0:t.name,u.featureGroup.correlation),p=L(),n=N(),{canEdit:v,isLoading:D,isDataScientist:S}=O();m.useEffect(()=>{n.featureGroupStatisticsCommits.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o}),n.featureGroupStatistics.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o,computationTime:a})},[e,o,n,r,a]);const F=m.useCallback(()=>{n.featureGroupStatisticsCommits.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o}),n.featureGroupStatistics.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o,computationTime:a})},[n.featureGroupStatisticsCommits,n.featureGroupStatistics,e,r,o,a]),T=m.useCallback((s,c=o)=>{s&&a!==s&&p(G(u.featureGroup.correlationViewCommit,u.project.value,{id:e,fsId:r,fgId:c,computationTime:s}))},[e,r,p,o,a]),f=m.useMemo(()=>V(y(P,["extendedStatistics","correlations"]),d??{}),[d]);return k(`${w.correlation} ${t!=null&&t.name?t.name:"Feature group"}`),!h&&!t?i.jsx(R,{}):h?i.jsx(j,{}):i.jsxs(i.Fragment,{children:[i.jsx(H,{title:t.name,data:t,idColor:(t==null?void 0:t.type)==="onDemandFeaturegroupDTO"?"labels.blue":"labels.orange",isEditDisabled:!v||S||D,onClickEdit:()=>p(G(u.featureGroup.edit,u.project.value,{id:e,fsId:r,fgId:o})),onClickRefresh:F,version:t==null?void 0:t.version,versions:I||[],isVersionsLoading:x,onVersionChange:b,hasCommits:!0,commits:C||[],commit:a,handleCommitChange:T,pathnamePostFix:"/correlation",editRightText:S?"Your role is not allowed to perform this action":void 0}),g&&i.jsx(j,{}),!g&&(!f||$(f)?i.jsx(K,{mainText:"No feature correlation",secondaryText:""}):i.jsx(M,{item:t,correlation:f,type:q.fg}))]})};export{gt as default};
