"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[5336],{452630:(e,t,a)=>{t.iB=t.YM=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},n=s(a(667294)),i=s(a(45697)),o=a(402371);function s(e){return e&&e.__esModule?e:{default:e}}t.YM=function(e){var t=e.itemTypeToComponent,a=e.WrapperComponent,s=void 0===a?"div":a,l=function(e){var a=e.currentPage,i=e.totalPages,l=e.boundaryPagesRange,c=e.siblingPagesRange,u=e.hideEllipsis,g=e.hidePreviousAndNextPageLinks,d=e.hideFirstAndLastPageLinks,P=e.onChange,E=e.disabled,h=function(e,t){var a={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(a[r]=e[r]);return a}(e,["currentPage","totalPages","boundaryPagesRange","siblingPagesRange","hideEllipsis","hidePreviousAndNextPageLinks","hideFirstAndLastPageLinks","onChange","disabled"]),p=(0,o.getPaginationModel)({currentPage:a,totalPages:i,boundaryPagesRange:l,siblingPagesRange:c,hideEllipsis:u,hidePreviousAndNextPageLinks:g,hideFirstAndLastPageLinks:d}),S=function(e,t,a){return function(i){var o,s,l,c=e[i.type],u=(s=(o=i).value,l=o.isDisabled,function(){!l&&a&&t!==s&&a(s)});return n.default.createElement(c,r({onClick:u},i))}}(t,a,P);return n.default.createElement(s,h,p.map((function(e){return S(r({},e,{isDisabled:!!E}))})))};return l.propTypes={currentPage:i.default.number.isRequired,totalPages:i.default.number.isRequired,boundaryPagesRange:i.default.number,siblingPagesRange:i.default.number,hideEllipsis:i.default.bool,hidePreviousAndNextPageLinks:i.default.bool,hideFirstAndLastPageLinks:i.default.bool,onChange:i.default.func,disabled:i.default.bool},l},t.iB=o.ITEM_TYPES},194222:(e,t,a)=>{a.d(t,{Z:()=>u});var r=a(751995),n=a(61988),i=a(358593),o=a(313322),s=a(690335),l=a(135944);function c(e,t,a){switch(e){case s.Z9.Working:return a.colors.primary.base;case s.Z9.Error:return a.colors.error.base;case s.Z9.Success:return t?a.colors.success.base:a.colors.alert.base;case s.Z9.Noop:return a.colors.success.base;case s.Z9.Grace:return a.colors.alert.base;default:return a.colors.grayscale.base}}function u({state:e,isReportEnabled:t=!1}){const a=(0,r.Fg)(),u={icon:o.Z.Check,label:"",status:""};switch(e){case s.Z9.Success:u.icon=t?o.Z.Check:o.Z.AlertSolidSmall,u.label=t?(0,n.t)("Report sent"):(0,n.t)("Alert triggered, notification sent"),u.status=s.Z9.Success;break;case s.Z9.Working:u.icon=o.Z.Running,u.label=t?(0,n.t)("Report sending"):(0,n.t)("Alert running"),u.status=s.Z9.Working;break;case s.Z9.Error:u.icon=o.Z.XSmall,u.label=t?(0,n.t)("Report failed"):(0,n.t)("Alert failed"),u.status=s.Z9.Error;break;case s.Z9.Noop:u.icon=o.Z.Check,u.label=(0,n.t)("Nothing triggered"),u.status=s.Z9.Noop;break;case s.Z9.Grace:u.icon=o.Z.AlertSolidSmall,u.label=(0,n.t)("Alert Triggered, In Grace Period"),u.status=s.Z9.Grace;break;default:u.icon=o.Z.Check,u.label=(0,n.t)("Nothing triggered"),u.status=s.Z9.Noop}const g=u.icon;return(0,l.tZ)(i.u,{title:u.label,placement:"bottomLeft",children:(0,l.tZ)(g,{iconColor:c(u.status,t,a)})})}},690335:(e,t,a)=>{var r,n,i,o;a.d(t,{Z9:()=>n,bx:()=>o,cv:()=>r}),function(e){e.Email="Email",e.Slack="Slack",e.SlackV2="SlackV2"}(r||(r={})),function(e){e.Success="Success",e.Working="Working",e.Error="Error",e.Noop="Not triggered",e.Grace="On Grace"}(n||(n={})),function(e){e.Email="Email",e.Slack="Slack",e.SlackV2="SlackV2"}(i||(i={})),function(e){e.General="generalSection",e.Content="contentSection",e.Alert="alertConditionSection",e.Schedule="scheduleSection",e.Notification="notificationSection"}(o||(o={}))},458883:(e,t,a)=>{a.r(t),a.d(t,{default:()=>_});var r=a(751995),n=a(211965),i=a(61988),o=a(730381),s=a.n(o),l=a(667294),c=a(616550),u=a(473727),g=a(593139),d=a(358593),P=a(586074),E=a(414114),h=a(444814),p=a(194222),S=a(34858),b=a(135944);const f=r.iK.div`
  ${({theme:e})=>n.iv`
    display: flex;
    flex-direction: row;

    a,
    Link {
      margin-left: ${4*e.gridUnit}px;
      font-size: ${e.typography.sizes.s};
      font-weight: ${e.typography.weights.normal};
      text-decoration: underline;
    }
  `}
`,_=(0,E.ZP)((function({addDangerToast:e,addSuccessToast:t,isReportEnabled:a}){const{alertId:r}=(0,c.UO)(),{state:{loading:n,resourceCount:o,resourceCollection:E},fetchData:_}=(0,S.Yi)(`report/${r}/log`,(0,i.t)("log"),e,!1),{state:{loading:I,resource:L},fetchResource:m}=(0,S.LE)("report",(0,i.t)("reports"),e);(0,l.useEffect)((()=>{null===r||I||m(r)}),[r]);const v=(0,l.useMemo)((()=>[{Cell:({row:{original:{state:e}}})=>(0,b.tZ)(p.Z,{state:e,isReportEnabled:a}),accessor:"state",Header:(0,i.t)("State"),size:"xs",disableSortBy:!0},{Cell:({row:{original:{uuid:e}}})=>e?e.slice(0,6):"none",accessor:"uuid",Header:(0,i.t)("Execution ID"),size:"xs",disableSortBy:!0},{Cell:({row:{original:{scheduled_dttm:e}}})=>s()(new Date(e)).format("YYYY-MM-DD hh:mm:ss a"),accessor:"scheduled_dttm",Header:(0,i.t)("Scheduled at (UTC)")},{Cell:({row:{original:{start_dttm:e}}})=>s()(new Date(e)).format("YYYY-MM-DD hh:mm:ss a"),Header:(0,i.t)("Start at (UTC)"),accessor:"start_dttm"},{Cell:({row:{original:{start_dttm:e,end_dttm:t}}})=>(0,h.zQ)(new Date(e).getTime(),new Date(t).getTime()),Header:(0,i.t)("Duration"),disableSortBy:!0},{accessor:"value",Header:(0,i.t)("Value")},{accessor:"error_message",Header:(0,i.t)("Error message"),Cell:({row:{original:{error_message:e=""}}})=>(0,b.tZ)(d.u,{title:e,placement:"topLeft",children:(0,b.tZ)("span",{children:e})})}]),[a]),T=`/${a?"report":"alert"}/list/`,N=(0,i.t)("Alert"),k=(0,i.t)("Report");return(0,b.BX)(b.HY,{children:[(0,b.tZ)(P.Z,{name:(0,b.BX)(f,{children:[(0,b.BX)("span",{children:[L?"Alert"===L.type?`${N}:`:"Report"===L.type?`${k}:`:null:null," ",null==L?void 0:L.name]}),(0,b.tZ)("span",{children:(0,b.tZ)(u.rU,{to:T,children:(0,i.t)("Back to all")})})]})}),(0,b.tZ)(g.Z,{className:"execution-log-list-view",columns:v,count:o,data:E,fetchData:_,initialSort:[{id:"start_dttm",desc:!0}],loading:n,addDangerToast:e,addSuccessToast:t,refreshData:()=>{},pageSize:25})]})}))},656590:(e,t)=>{t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOUS_PAGE_LINK:"PREVIOUS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},653804:(e,t,a)=>{var r=a(656590);t.createFirstEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.FIRST_PAGE_LINK,key:r.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:r.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.NEXT_PAGE_LINK,key:r.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(a,t+1),isActive:t===a}},t.createLastPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.LAST_PAGE_LINK,key:r.ITEM_KEYS.LAST_PAGE_LINK,value:a,isActive:t===a}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:r.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},1158:(e,t)=>{t.createRange=function(e,t){for(var a=[],r=e;r<=t;r++)a.push(r);return a}},402371:(e,t,a)=>{var r=a(1158),n=a(653804);t.getPaginationModel=function(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var t=Number(e.totalPages);if(isNaN(t))throw new Error("getPaginationModel(): totalPages should be a number");if(t<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var a=Number(e.currentPage);if(isNaN(a))throw new Error("getPaginationModel(): currentPage should be a number");if(a<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(a>t)throw new Error("getPaginationModel(): currentPage shouldn't be greater than totalPages");var i=null==e.boundaryPagesRange?1:Number(e.boundaryPagesRange);if(isNaN(i))throw new Error("getPaginationModel(): boundaryPagesRange should be a number");if(i<0)throw new Error("getPaginationModel(): boundaryPagesRange shouldn't be a negative number");var o=null==e.siblingPagesRange?1:Number(e.siblingPagesRange);if(isNaN(o))throw new Error("getPaginationModel(): siblingPagesRange should be a number");if(o<0)throw new Error("getPaginationModel(): siblingPagesRange shouldn't be a negative number");var s=Boolean(e.hidePreviousAndNextPageLinks),l=Boolean(e.hideFirstAndLastPageLinks),c=Boolean(e.hideEllipsis),u=c?0:1,g=[],d=n.createPageFunctionFactory(e);if(l||g.push(n.createFirstPageLink(e)),s||g.push(n.createPreviousPageLink(e)),1+2*u+2*o+2*i>=t){var P=r.createRange(1,t).map(d);g.push.apply(g,P)}else{var E=i,h=r.createRange(1,E).map(d),p=t+1-i,S=t,b=r.createRange(p,S).map(d),f=Math.min(Math.max(a-o,E+u+1),p-u-2*o-1),_=f+2*o,I=r.createRange(f,_).map(d);if(g.push.apply(g,h),!c){var L=f-1,m=(L===E+1?d:n.createFirstEllipsis)(L);g.push(m)}if(g.push.apply(g,I),!c){var v=_+1,T=(v===p-1?d:n.createSecondEllipsis)(v);g.push(T)}g.push.apply(g,b)}return s||g.push(n.createNextPageLink(e)),l||g.push(n.createLastPageLink(e)),g};var i=a(656590);t.ITEM_TYPES=i.ITEM_TYPES,t.ITEM_KEYS=i.ITEM_KEYS}}]);
//# sourceMappingURL=c1ffa34d705eae09b4fd.chunk.js.map