File: //opt/netdata/usr/local/local/share/netdata/web/v3/5030.902dad2e65b0c552e3bc.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"6866bb78c87eb499c83445c224071f481cf2061d"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ddd554b4-1663-4121-86e7-0091d6840635",e._sentryDebugIdIdentifier="sentry-dbid-ddd554b4-1663-4121-86e7-0091d6840635")}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(32370),d=n(45710),l=n(42539),u=n(52365),f=n(75156),h=n(92516),m=n(1108),p=n(5305),g=n(96054),b=n(61501),x=n(10911),D=n(91349);function w(e,t,n){const a=(0,h.q)(),r=n?.locale??a.locale??f.c,o=(0,g.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,p.x)(n?.in,...o>0?[t,e]:[e,t]),d=(0,D.O)(c,s),l=((0,m.G)(c)-(0,m.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<b.F6){const e=Math.round(u/60);return r.formatDistance("aboutXHours",e,i)}if(u<2520)return r.formatDistance("xDays",1,i);if(u<b.Nw){const e=Math.round(u/b.F6);return r.formatDistance("xDays",e,i)}if(u<2*b.Nw)return w=Math.round(u/b.Nw),r.formatDistance("aboutXMonths",w,i);if(w=(0,x.W)(c,s),w<12){const e=Math.round(u/b.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(38429),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)(),[h,m]=(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&&m(!0))},[t]),window.envSettings.onprem&&n?h?(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}}}]);