!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"768c393028531b48d077404b24343b320adb8107"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="04aa70ba-be2e-4bdb-87ef-0a06880bfc33",e._sentryDebugIdIdentifier="sentry-dbid-04aa70ba-be2e-4bdb-87ef-0a06880bfc33")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[5030],{75030(e,t,n){n.r(t),n.d(t,{default:()=>v});var a=n(96540),r=n(52035),o=n(34843),i=n(25316),s=n(41394),c=n(99790),d=n(45710),l=n(42539),u=n(52365),f=n(75156),b=n(92516),h=n(1108),m=n(5305),p=n(96054),g=n(61501),x=n(34364),D=n(91349);function w(e,t,n){const a=(0,b.q)(),r=n?.locale??a.locale??f.c,o=(0,p.z)(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const i=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[s,c]=(0,m.x)(n?.in,...o>0?[t,e]:[e,t]),d=(0,D.O)(c,s),l=((0,h.G)(c)-(0,h.G)(s))/1e3,u=Math.round((d-l)/60);let w;if(u<2)return n?.includeSeconds?d<5?r.formatDistance("lessThanXSeconds",5,i):d<10?r.formatDistance("lessThanXSeconds",10,i):d<20?r.formatDistance("lessThanXSeconds",20,i):d<40?r.formatDistance("halfAMinute",0,i):d<60?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",1,i):0===u?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",u,i);if(u<45)return r.formatDistance("xMinutes",u,i);if(u<90)return r.formatDistance("aboutXHours",1,i);if(u<g.F6){const e=Math.round(u/60);return r.formatDistance("aboutXHours",e,i)}if(u<2520)return r.formatDistance("xDays",1,i);if(u<g.Nw){const e=Math.round(u/g.F6);return r.formatDistance("xDays",e,i)}if(u<2*g.Nw)return w=Math.round(u/g.Nw),r.formatDistance("aboutXMonths",w,i);if(w=(0,x.W)(c,s),w<12){const e=Math.round(u/g.Nw);return r.formatDistance("xMonths",e,i)}{const e=w%12,t=Math.trunc(w/12);return e<3?r.formatDistance("aboutXYears",t,i):e<9?r.formatDistance("overXYears",t,i):r.formatDistance("almostXYears",t+1,i)}}function y(e,t){return w(e,(0,u.A)(e),t)}var I=n(64587),S=n(91130),M=n(32977),j=n(56171),T=n(79748),k=n(6304),X=n(74848);const A=(0,r.eU)(()=>S.A.get("/api/v1/license").then(e=>e.data).catch(()=>null)),v=()=>{const{localeDateString:e}=(0,I.$j)(),t=(0,o.md)((0,i.A)(A)),[n,r]=(0,k.A)(),[u,f]=(0,a.useState)(),[b,h]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if("hasValue"!==t.state)return;const e=t.data?.data;if(!e)return;const n=(0,s.H)(e.exp);if(f(n),!(0,c.f)(n))return;const a=parseInt((n-new Date)/1e3/60/60/24);if(a>30)return;const o=localStorage.getItem("dismissLicenceWarning");o&&(0,c.f)((0,s.H)(o))&&!(0,d.R)((0,s.H)(o))&&a>0||(r(!0),a<0&&h(!0))},[t]),window.envSettings.onprem&&n?b?(0,X.jsx)(M.Layer,{full:!0,backdropProps:{backdropBlur:"3px"},children:(0,X.jsx)(j.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(u),". Please contact your admin /"," ",(0,X.jsx)(T.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)(j.A,{testId:"onprem-banner",width:"100%",background:"warningBackground",position:"absolute",top:"0",onClose:()=>{r(),localStorage.setItem("dismissLicenceWarning",(0,l.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 ",y(u),". Please contact your admin /"," ",(0,X.jsx)(T.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}}}]);