!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8ba2d2b1-5d36-4131-8386-688d2b629dac",e._sentryDebugIdIdentifier="sentry-dbid-8ba2d2b1-5d36-4131-8386-688d2b629dac")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[9768],{39768:function(e,t,n){n.r(t),n.d(t,{default:function(){return C}});var r=n(45987),o=n(29439),a=(n(92222),n(9170),n(66992),n(41539),n(88674),n(34668),n(78783),n(33948),n(21249),n(57640),n(9924),n(69826),n(31672),n(2490),n(59461),n(26699),n(32023),n(74916),n(64765),n(15306),n(67294)),i=n(89250),c=n(17563),u=n(26398),s=n(62200),d=n(13477),f=n(25819),l=n(93017),p=n(76201),g=n(74059),v=n(6308),w=n(4942);n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=e.origin,o=e.id,a=e.name;if(r){var i=decodeURIComponent(o),c=decodeURIComponent(r);(0,E.kq)(o).then((function(e){var r=e.data,o=void 0===r?[]:r;return n(i,c,a),o.length?u.Z.get(s.MC).then((function(e){var t=e.data;return Promise.any(t.map((function(e){return u.Z.get((0,O.W)({spaceId:e.id})).then((function(t){var n=t.data;return Promise.any(n.map((function(t){return(0,f.Fz)({roomId:t.id,spaceId:e.id}).then((function(n){var r=n.nodes.find((function(e){var t=e.id;return o.includes(t)}));if(!r)throw new Error("can't find matching node");var a=window.location,i=a.protocol,c=a.host;return"".concat(i,"//").concat(c,"/spaces/").concat(e.slug,"/rooms/").concat(t.slug,"/nodes/").concat(r.id)}))})))}))})))})).catch((function(){})):(0,E.YZ)(i).then((function(e){var n=e.data.claimed;throw t(n?{errorMsgKey:"ErrForbidden",errorMessage:"You tried to access this Node on Netdata and you don't have access to it. Please contact your Space admin to give you access to it."}:{errorMsgKey:"ErrForbidden",errorMessage:"This Node isn't connected to Netdata. Please connect it, if you have permission for it, or contact your Space admin."}),"no access"}))})).then((function(e){e&&setTimeout(location.assign(e))})).catch((function(){}))}}),[])}(),m=(0,P.Z)();if(!e||m.isFetching||m.hasAccess&&!w||n)return null;var _=window.location,C=_.pathname,D=_.search,R=_.hash,A=c.parse(R),N=A.error_retry,U=A.token,F=c.parse(D),z=F.cloudRoute,T=F.redirect_uri,M=(0,r.Z)(F,x);if(!t&&N)return a.createElement(Z,{errorRetry:N,token:U,redirectUri:T});if(!t&&w){if(z){var L=z.includes("join-callback")?decodeURI(z):z,H=Array.isArray(L)?L[0]:L;return a.createElement(i.Fg,{replace:!0,to:H})}return T?(h(M),window.location.replace(decodeURIComponent(T)),null):a.createElement(i.Fg,{replace:!0,to:"/spaces"})}if(I.ZP)return null;if(t&&!w){var G=R.includes("join-callback")?R:encodeURIComponent(R),K="".concat(D).concat(D?"&":"?","cloudRoute=").concat(C);return a.createElement(i.Fg,{replace:!0,to:{pathname:"/sign-in",search:K,hash:G}})}return null}},7335:function(e,t,n){n.d(t,{aG:function(){return E},H3:function(){return _},XU:function(){return O},DH:function(){return k},z2:function(){return y},lL:function(){return b}});var r=n(29439),o=n(93433),a=n(15861),i=n(4942),c=n(64687),u=n.n(c),s=(n(21249),n(57640),n(9924),n(85827),n(41539),n(25387),n(2490),n(72608),n(57327),n(88449),n(59849),n(26699),n(32023),n(92222),n(66992),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(69826),n(31672),n(59461),n(2707),n(47941),n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),d=n(4480),f=n(89250),l=n(13477),p=(0,d.xu)({key:"visitedNodes",default:function(){return[]}}),g=n(97945),v=n(18761);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{}).autoFetch,n=void 0===t||t,o=(0,d.FV)(p(e)),a=(0,r.Z)(o,2)[1],i=(0,s.useState)(0),c=(0,r.Z)(i,2),u=c[0],f=c[1],l=(0,s.useCallback)((function(){f((function(e){return e+1}))}),[f]);return(0,s.useEffect)((function(){e&&(n||u)&&(0,v.Fz)(e).then((function(e){if(e){var t=e.data.results.sort((function(e,t){return new Date(t.lastAccessTime)-new Date(e.lastAccessTime)}));a(t)}}))}),[n,u,e]),l},O=function(){var e=(0,l.jr)(),t=p(e);return(0,d._8)((function(e){var n=e.snapshot,r=e.set;return function(){var e=(0,a.Z)(u().mark((function e(o){var a,i,c,s;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.getPromise((0,g.$E)(o));case 2:return a=e.sent,i=a.map((function(e){return e.machineGUID})),e.next=6,n.getPromise(t);case 6:c=e.sent,(s=c.filter((function(e){return!i.includes(e.id)}))).length!==c.length&&r(t,s);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),[e])}},11060:function(e,t,n){var r=n(1702),o=Error,a=r("".replace),i=String(new o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(i);e.exports=function(e,t){if(u&&"string"==typeof e&&!o.prepareStackTrace)for(;t--;)e=a(e,c,"");return e}},5392:function(e,t,n){var r=n(68880),o=n(11060),a=n(22914),i=Error.captureStackTrace;e.exports=function(e,t,n,c){a&&(i?i(e,t):r(e,"stack",o(n,c)))}},22914:function(e,t,n){var r=n(47293),o=n(79114);e.exports=!r((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",o(1,7)),7!==e.stack)}))},58340:function(e,t,n){var r=n(70111),o=n(68880);e.exports=function(e,t){r(t)&&"cause"in t&&o(e,"cause",t.cause)}},56277:function(e,t,n){var r=n(41340);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},56967:function(e,t,n){var r=n(82109),o=n(47976),a=n(79518),i=n(27674),c=n(99920),u=n(70030),s=n(68880),d=n(79114),f=n(58340),l=n(5392),p=n(20408),g=n(56277),v=n(5112)("toStringTag"),w=Error,h=[].push,m=function(e,t){var n,r=o(y,this);i?n=i(new w,r?a(this):y):(n=r?this:u(y),s(n,v,"Error")),void 0!==t&&s(n,"message",g(t)),l(n,m,n.stack,1),arguments.length>2&&f(n,arguments[2]);var c=[];return p(e,h,{that:c}),s(n,"errors",c),n};i?i(m,w):c(m,w,{name:!0});var y=m.prototype=u(w.prototype,{constructor:d(1,m),message:d(1,""),name:d(1,"AggregateError")});r({global:!0,constructor:!0,arity:2},{AggregateError:m})},9170:function(e,t,n){n(56967)},34668:function(e,t,n){var r=n(82109),o=n(46916),a=n(19662),i=n(35005),c=n(78523),u=n(12534),s=n(20408),d=n(80612),f="No one promise resolved";r({target:"Promise",stat:!0,forced:d},{any:function(e){var t=this,n=i("AggregateError"),r=c.f(t),d=r.resolve,l=r.reject,p=u((function(){var r=a(t.resolve),i=[],c=0,u=1,p=!1;s(e,(function(e){var a=c++,s=!1;u++,o(r,t,e).then((function(e){s||p||(p=!0,d(e))}),(function(e){s||p||(s=!0,i[a]=e,--u||l(new n(i,f)))}))})),--u||l(new n(i,f))}));return p.error&&l(p.value),r.promise}})}}]);