"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3191],{18575:(e,a,t)=>{a.w$=a.uv=void 0;var r=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},n=s(t(96540)),i=s(t(5556)),o=t(11447);function s(e){return e&&e.__esModule?e:{default:e}}a.uv=function(e){var a=e.itemTypeToComponent,t=e.WrapperComponent,s=void 0===t?"div":t,l=function(e){var t=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,a){var t={};for(var r in e)a.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}(e,["currentPage","totalPages","boundaryPagesRange","siblingPagesRange","hideEllipsis","hidePreviousAndNextPageLinks","hideFirstAndLastPageLinks","onChange","disabled"]),p=(0,o.getPaginationModel)({currentPage:t,totalPages:i,boundaryPagesRange:l,siblingPagesRange:c,hideEllipsis:u,hidePreviousAndNextPageLinks:g,hideFirstAndLastPageLinks:d}),S=function(e,a,t){return function(i){var o,s,l,c=e[i.type],u=(s=(o=i).value,l=o.isDisabled,function(){!l&&t&&a!==s&&t(s)});return n.default.createElement(c,r({onClick:u},i))}}(a,t,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},a.w$=o.ITEM_TYPES},88014:(e,a,t)=>{t.d(a,{A:()=>u});var r=t(96453),n=t(95579),i=t(19129),o=t(12249),s=t(47815),l=t(2445);function c(e,a,t){switch(e){case s.Or.Working:return t.colors.primary.base;case s.Or.Error:return t.colors.error.base;case s.Or.Success:return a?t.colors.success.base:t.colors.warning.base;case s.Or.Noop:return t.colors.success.base;case s.Or.Grace:return t.colors.warning.base;default:return t.colors.grayscale.base}}function u({state:e,isReportEnabled:a=!1}){const t=(0,r.DP)(),u={icon:o.A.Check,label:"",status:""};switch(e){case s.Or.Success:u.icon=a?o.A.Check:o.A.AlertSolidSmall,u.label=a?(0,n.t)("Report sent"):(0,n.t)("Alert triggered, notification sent"),u.status=s.Or.Success;break;case s.Or.Working:u.icon=o.A.Running,u.label=a?(0,n.t)("Report sending"):(0,n.t)("Alert running"),u.status=s.Or.Working;break;case s.Or.Error:u.icon=o.A.XSmall,u.label=a?(0,n.t)("Report failed"):(0,n.t)("Alert failed"),u.status=s.Or.Error;break;case s.Or.Noop:u.icon=o.A.Check,u.label=(0,n.t)("Nothing triggered"),u.status=s.Or.Noop;break;case s.Or.Grace:u.icon=o.A.AlertSolidSmall,u.label=(0,n.t)("Alert Triggered, In Grace Period"),u.status=s.Or.Grace;break;default:u.icon=o.A.Check,u.label=(0,n.t)("Nothing triggered"),u.status=s.Or.Noop}const g=u.icon;return(0,l.Y)(i.m,{title:u.label,placement:"bottomLeft",children:(0,l.Y)(g,{iconColor:c(u.status,a,t)})})}},47815:(e,a,t)=>{var r,n,i,o,s;t.d(a,{Or:()=>n,Z_:()=>o,cM:()=>s,yV:()=>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={})),function(e){e.Dashboard="dashboard",e.Chart="chart"}(s||(s={}))},63297:(e,a,t)=>{t.r(a),t.d(a,{default:()=>_});var r=t(96453),n=t(17437),i=t(95579),o=t(74353),s=t.n(o),l=t(96540),c=t(61574),u=t(71519),g=t(39854),d=t(19129),P=t(51713),E=t(5261),h=t(7089),p=t(88014),S=t(50500),b=t(2445);const f=r.I4.div`
  ${({theme:e})=>n.AH`
    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.Ay)((function({addDangerToast:e,addSuccessToast:a,isReportEnabled:t}){const{alertId:r}=(0,c.g)(),{state:{loading:n,resourceCount:o,resourceCollection:E},fetchData:_}=(0,S.RU)(`report/${r}/log`,(0,i.t)("log"),e,!1),{state:{loading:I,resource:m},fetchResource:L}=(0,S.fn)("report",(0,i.t)("reports"),e);(0,l.useEffect)((()=>{null===r||I||L(r)}),[r]);const A=(0,l.useMemo)((()=>[{Cell:({row:{original:{state:e}}})=>(0,b.Y)(p.A,{state:e,isReportEnabled:t}),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:a}}})=>(0,h.RW)(new Date(e).getTime(),new Date(a).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.Y)(d.m,{title:e,placement:"topLeft",children:(0,b.Y)("span",{children:e})})}]),[t]),v=`/${t?"report":"alert"}/list/`,T=(0,i.t)("Alert"),N=(0,i.t)("Report");return(0,b.FD)(b.FK,{children:[(0,b.Y)(P.A,{name:(0,b.FD)(f,{children:[(0,b.FD)("span",{children:[m?"Alert"===m.type?`${T}:`:"Report"===m.type?`${N}:`:null:null," ",null==m?void 0:m.name]}),(0,b.Y)("span",{children:(0,b.Y)(u.N_,{to:v,children:(0,i.t)("Back to all")})})]})}),(0,b.Y)(g.A,{className:"execution-log-list-view",columns:A,count:o,data:E,fetchData:_,initialSort:[{id:"start_dttm",desc:!0}],loading:n,addDangerToast:e,addSuccessToast:a,refreshData:()=>{},pageSize:25})]})}))},30327:(e,a)=>{a.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"},a.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},8960:(e,a,t)=>{var r=t(30327);a.createFirstEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},a.createSecondEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},a.createFirstPageLink=function(e){var a=e.currentPage;return{type:r.ITEM_TYPES.FIRST_PAGE_LINK,key:r.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===a}},a.createPreviousPageLink=function(e){var a=e.currentPage;return{type:r.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:r.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,a-1),isActive:1===a}},a.createNextPageLink=function(e){var a=e.currentPage,t=e.totalPages;return{type:r.ITEM_TYPES.NEXT_PAGE_LINK,key:r.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(t,a+1),isActive:a===t}},a.createLastPageLink=function(e){var a=e.currentPage,t=e.totalPages;return{type:r.ITEM_TYPES.LAST_PAGE_LINK,key:r.ITEM_KEYS.LAST_PAGE_LINK,value:t,isActive:a===t}},a.createPageFunctionFactory=function(e){var a=e.currentPage;return function(e){return{type:r.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===a}}}},17991:(e,a)=>{a.createRange=function(e,a){for(var t=[],r=e;r<=a;r++)t.push(r);return t}},11447:(e,a,t)=>{var r=t(17991),n=t(8960);a.getPaginationModel=function(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var a=Number(e.totalPages);if(isNaN(a))throw new Error("getPaginationModel(): totalPages should be a number");if(a<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var t=Number(e.currentPage);if(isNaN(t))throw new Error("getPaginationModel(): currentPage should be a number");if(t<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(t>a)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>=a){var P=r.createRange(1,a).map(d);g.push.apply(g,P)}else{var E=i,h=r.createRange(1,E).map(d),p=a+1-i,S=a,b=r.createRange(p,S).map(d),f=Math.min(Math.max(t-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 m=f-1,L=(m===E+1?d:n.createFirstEllipsis)(m);g.push(L)}if(g.push.apply(g,I),!c){var A=_+1,v=(A===p-1?d:n.createSecondEllipsis)(A);g.push(v)}g.push.apply(g,b)}return s||g.push(n.createNextPageLink(e)),l||g.push(n.createLastPageLink(e)),g};var i=t(30327);a.ITEM_TYPES=i.ITEM_TYPES,a.ITEM_KEYS=i.ITEM_KEYS}}]);