"use strict";(self.webpackChunkhopsworks_front=self.webpackChunkhopsworks_front||[]).push([[6823],{76823:function(t,e,i){i.r(e);var r=i(29439),o=i(72791),a=i(82222),u=i(16871),n=i(43504),s=i(95048),c=i(76237),f=i(97030),d=i(70477),l=i(71286),v=i(97355),m=i(81497),p=i(91813),I=i(62618),G=i(59728),h=i(1281),Z=i(754),C=i(76871),S=i(80184);e.default=function(){var t=c._G.DATE_TIME.DATE_TIME_FULL,e=(0,u.UO)(),i=e.id,g=e.fsId,j=e.fgId,k=e.commitTime,b=(0,n.useSearchParams)(),w=(0,r.Z)(b,1)[0],E=(0,C.Z)(),T=E.canEdit,x=E.isLoading,V=(0,s.v9)((function(t){var e;return null===(e=t.featureGroupStatistics)||void 0===e?void 0:e.entities.statistics})),D=(0,s.v9)((function(t){return t.featureGroupStatisticsCommits})),_=(0,s.v9)((function(t){return t.loading.effects.featureGroupStatistics.fetch})),L=(0,d.Z)(+i,+j,+g),F=L.data,M=L.isLoading,O=(0,s.I0)(),P=(0,u.s0)(),U=(0,o.useCallback)((function(){O.featureGroupStatisticsCommits.fetch({projectId:+i,featureStoreId:+g,featureGroupId:+j}),O.featureGroupStatistics.fetch({projectId:+i,featureStoreId:+g,featureGroupId:+j,timeCommit:k})}),[O.featureGroupStatisticsCommits,O.featureGroupStatistics,i,g,j,k]),A=(0,o.useMemo)((function(){var e=k;return D.length>0&&(e&&e!==D[0]?Number.isInteger(+e)&&(e=(0,a.Z)(+e,t)):e="".concat((0,a.Z)(+D[0],t)," (latest)")),e}),[k,D,t]),N=(0,o.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j,o=e;null!==e&&void 0!==e&&e.includes("(latest)")&&(o=e.slice(0,e.indexOf(" (latest)")));var u=D.find((function(e){return(0,a.Z)(+e,t)===o})),n=D.find((function(e){var i=(0,a.Z)(+e,t);return i===A||"".concat(i," (latest)")===A}));if(u&&n!==u){var s=h.Z.featureGroup.statisticsViewCommit,c={id:i,fsId:g,fgId:r,commitTime:u};P((0,Z.Z)(s,h.Z.project.value,c)+(w?"?".concat(w):""))}else P((0,Z.Z)(h.Z.featureGroup.statistics,h.Z.project.value,{id:i,fsId:g,fgId:r})+(w?"?".concat(w):""))}),[i,g,D,P,j,A,t,w]),y=(0,o.useCallback)((function(t){var e=(0,r.Z)(t,1)[0];N(e)}),[N]);(0,o.useEffect)((function(){return O.featureGroupStatisticsCommits.fetch({projectId:+i,featureStoreId:+g,featureGroupId:+j}),O.featureGroupStatistics.fetch({projectId:+i,featureStoreId:+g,featureGroupId:+j,timeCommit:k}),function(){O.featureGroupDataPreview.clear()}}),[i,j,O,g,k]);var R=(0,o.useCallback)((function(t){var e,i,r=null===F||void 0===F||null===(e=F.versions)||void 0===e||null===(i=e.find((function(e){return e.version===+t})))||void 0===i?void 0:i.id;r&&N(A,String(r))}),[F,A,N]);return(0,I.Z)("".concat(G.Z.statistics," ").concat(null!==F&&void 0!==F&&F.name?" - ".concat(F.name):"")),M||_?(0,S.jsx)(m.Z,{}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(v.Z,{type:p.C.fg,data:F,title:null===F||void 0===F?void 0:F.name,id:null===F||void 0===F?void 0:F.id,idColor:"labels.orange",isEditDisabled:!T||x,onClickEdit:function(){return P((0,Z.Z)(h.Z.featureGroup.edit,h.Z.project.value,{id:i,fsId:g,fgId:j}))},onClickRefresh:U,hasVersion:!0,version:null===F||void 0===F?void 0:F.version,versions:(null===F||void 0===F?void 0:F.versions)||[],onVersionChange:R,hasCommits:!0,commits:D||[],commit:A,handleCommitChange:y,pathnamePostFix:"/statistics"}),null!==F&&void 0!==F&&F.features.length&&V?(0,S.jsx)(l.Z,{data:F,statistics:V}):(0,S.jsx)(f.Z,{mainText:"No data available"})]})}},70477:function(t,e,i){var r=i(72791),o=i(95048),a=i(16871),u=i(38184);e.Z=function(t,e,i){var n=(0,a.UO)().commitTime,s=(0,u.T)({fsId:i}).currentData,c=(0,o.v9)((function(t){return t.loading.effects.featureGroupView.fetch})),f=(0,o.v9)((function(t){return t.featureGroupView})),d=(0,o.I0)(),l=(0,r.useCallback)((function(){return d.featureGroupStatistics.clear(),s&&i&&!c?(d.featureGroupStatistics.fetch({projectId:+t,featureStoreId:i,featureGroupId:+e,timeCommit:n}),d.featureGroupView.fetch({projectId:t,featureStoreId:i,featureGroupId:e})):{}}),[d.featureGroupStatistics,d.featureGroupView,s,i,c,t,e,n]);return(0,r.useEffect)((function(){e===(null===f||void 0===f?void 0:f.id)&&i===f.featurestoreId||l()}),[null===f||void 0===f?void 0:f.id,null===f||void 0===f?void 0:f.featurestoreId,t,e,i,l]),{data:f,isLoading:c||!f,fetchData:l}}}}]);
//# sourceMappingURL=6823.6b32d9bd.chunk.js.map