!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]="9a8199b4-6cc5-4282-a0ba-8a4cdd805153",e._sentryDebugIdIdentifier="sentry-dbid-9a8199b4-6cc5-4282-a0ba-8a4cdd805153")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"9332d759e18bd663bd9f8bd6b7633616d12f17f2"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[7840],{17840:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var o=n(96540),r=n(47767),a=(n(17333),n(41393),n(8159),n(98992),n(54520),n(81454),n(37550),n(8573)),d=n(22292),c=n(79731),l=n(9224);const s=new URLSearchParams(window.location.search.substr(1)),i=()=>{location.assign(`https://registry.my-netdata.io/goto-host-from-alarm.html${location.search}`)},u=e=>fetch(e,{redirect:"follow"}).then((()=>e)),f=e=>{let t="top;nowelcome=1";for(let[o,r]of s.entries())o=decodeURIComponent(o),"agentID"!==o&&(t+=`;${encodeURIComponent(o)}`,r=decodeURIComponent(r),""!==r&&(t+=`=${encodeURIComponent(r)}`));const n=new URL(e);return"/"===n.pathname&&(n.pathname=""),n.hash=t,n.toString()},p=(e,t)=>{if(!s.has("agentID"))return void(document.body.innerHTML='<p>missing "agentID" query string parameter</p>');(async(e,t)=>{try{return(await(0,l.tz)(t,e)).data}catch(n){const{data:e}=n.response;document.body.innerHTML=`${(0,c.o)(e?.errorMsgKey)}</br></br>Getting you back to Netdata...`;const t=new Error((0,c.o)(e?.errorMsgKey)||"Redirect error");throw t.name=`${e?.errorMsgKey||"Server error"}`,t.stack=`${e?.errorCode||"Redirect error code"}`,t}})(decodeURIComponent(s.get("agentID")||"unknown_agent_id"),e).catch((e=>{if("ErrVisitedNodeNotFound"!==e?.name)throw document.body.innerHTML=`<p>${e?.message}</p>`,e;i()})).then((e=>{const n=e?.urls?.map(f),o="https:"===location.protocol&&n.some((e=>!e.startsWith("https:"))),r=o?n.filter((e=>e.startsWith("https:"))):n;if(0!==r.length)return Promise.any(r.map(u)).then((()=>{location.assign(`url${t}`)}),(()=>{o?location.protocol="http:":document.body.innerHTML=`\n                <ul>\n                    ${n.map((e=>`<li><a href="${encodeURIComponent(e)}" target="_blank" rel="noopener noreferrer">${e}</a></li>`)).join("\n")}\n                </ul>\n            `}));o?location.protocol="http:":i()}))},h=()=>{const e=(0,d.NJ)(),{search:t}=(0,r.zy)();return(0,o.useEffect)((()=>{e&&p(e,t||"")}),[e,t]),o.createElement(a.H4,null,"Redirecting...")},m=()=>o.createElement(r.BV,null,o.createElement(r.qh,{path:"/redirects/alerts",element:o.createElement(h,null)}),o.createElement(r.qh,{path:"/redirects/alarms",element:o.createElement(h,null)})," ")}}]);