!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"8754b08e308d2722ff43ad1473703ef3d578ce90"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="384f6128-8be9-4e88-9f7f-bf3588898454",e._sentryDebugIdIdentifier="sentry-dbid-384f6128-8be9-4e88-9f7f-bf3588898454")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[9497],{91878(e,t,n){n.r(t),n.d(t,{default:()=>w});var a=n(96540),r=n(52035),o=n(34843),i=n(25316),s=n(42539),c=n(12296),d=n(45710),l=n(99790),u=n(41394),f=n(64587),h=n(91130),m=n(56327),p=n(56171),g=n(79748),b=n(6304),x=n(74848);const D=(0,r.eU)(()=>h.A.get("/api/v1/license").then(e=>e.data).catch(()=>null)),w=()=>{const{localeDateString:e}=(0,f.$j)(),t=(0,o.md)((0,i.A)(D)),[n,r]=(0,b.A)(),[h,w]=(0,a.useState)(),[y,I]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if("hasValue"!==t.state)return;const e=t.data?.data;if(!e)return;const n=(0,u.H)(e.exp);if(w(n),!(0,l.f)(n))return;const a=parseInt((n-new Date)/1e3/60/60/24);if(a>30)return;const o=localStorage.getItem("dismissLicenceWarning");o&&(0,l.f)((0,u.H)(o))&&!(0,d.R)((0,u.H)(o))&&a>0||(r(!0),a<0&&I(!0))},[t]),window.envSettings.onprem&&n?y?(0,x.jsx)(m.Layer,{full:!0,backdropProps:{backdropBlur:"3px"},children:(0,x.jsx)(p.A,{testId:"onprem-banner",width:"100%",background:"errorBackground",position:"absolute",top:"0",tooltipProps:{align:"top"},zIndex:20,children:(0,x.jsx)(m.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2,children:(0,x.jsxs)(m.Text,{children:["Your Netdata Enterprise On-prem License has expired on ",e(h),". Please contact your admin /"," ",(0,x.jsx)(g.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main",children:"billing@netdata.cloud"})," ","to renew your license."]})})})}):(0,x.jsx)(p.A,{testId:"onprem-banner",width:"100%",background:"warningBackground",position:"absolute",top:"0",onClose:()=>{r(),localStorage.setItem("dismissLicenceWarning",(0,s.W)(new Date,{days:1}).toISOString())},tooltipProps:{align:"top"},zIndex:20,children:(0,x.jsx)(m.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2,children:(0,x.jsxs)(m.Text,{children:["Your Netdata Enterprise On-prem License will expire in ",(0,c.m)(h),". Please contact your admin /"," ",(0,x.jsx)(g.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main",children:"billing@netdata.cloud"})," ","to renew your license."]})})}):null}},12296(e,t,n){n.d(t,{m:()=>h});var a=n(52365),r=n(75156),o=n(92516),i=n(1108),s=n(5305),c=n(96054),d=n(61501),l=n(34364),u=n(91349);function f(e,t,n){const a=(0,o.q)(),f=n?.locale??a.locale??r.c,h=(0,c.z)(e,t);if(isNaN(h))throw new RangeError("Invalid time value");const m=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:h}),[p,g]=(0,s.x)(n?.in,...h>0?[t,e]:[e,t]),b=(0,u.O)(g,p),x=((0,i.G)(g)-(0,i.G)(p))/1e3,D=Math.round((b-x)/60);let w;if(D<2)return n?.includeSeconds?b<5?f.formatDistance("lessThanXSeconds",5,m):b<10?f.formatDistance("lessThanXSeconds",10,m):b<20?f.formatDistance("lessThanXSeconds",20,m):b<40?f.formatDistance("halfAMinute",0,m):b<60?f.formatDistance("lessThanXMinutes",1,m):f.formatDistance("xMinutes",1,m):0===D?f.formatDistance("lessThanXMinutes",1,m):f.formatDistance("xMinutes",D,m);if(D<45)return f.formatDistance("xMinutes",D,m);if(D<90)return f.formatDistance("aboutXHours",1,m);if(D<d.F6){const e=Math.round(D/60);return f.formatDistance("aboutXHours",e,m)}if(D<2520)return f.formatDistance("xDays",1,m);if(D<d.Nw){const e=Math.round(D/d.F6);return f.formatDistance("xDays",e,m)}if(D<2*d.Nw)return w=Math.round(D/d.Nw),f.formatDistance("aboutXMonths",w,m);if(w=(0,l.W)(g,p),w<12){const e=Math.round(D/d.Nw);return f.formatDistance("xMonths",e,m)}{const e=w%12,t=Math.trunc(w/12);return e<3?f.formatDistance("aboutXYears",t,m):e<9?f.formatDistance("overXYears",t,m):f.formatDistance("almostXYears",t+1,m)}}function h(e,t){return f(e,(0,a.A)(e),t)}}}]);