try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9d65dc55-87cf-4945-9090-cb86bafd39ac",e._sentryDebugIdIdentifier="sentry-dbid-9d65dc55-87cf-4945-9090-cb86bafd39ac")}catch(e){}("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:{}).SENTRY_RELEASE={id:"3c3ec92b9804220c7220d2a736674a446591eb9f"};(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3439],{3203:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(96540),l=a(3319),r=a(74848);const o=e=>t=>{let{callback:a,feature:o,isStart:d,isSuccess:s,isFailure:c,eventReason:i,payload:u={},...f}=t;const{sendLog:b,isReady:g}=(0,l.A)(),h=(0,n.useCallback)((e=>{const t=f[a],n={feature:o,isStart:d,isSuccess:s,isFailure:c,eventReason:i,...u,...f["data-ga"]?{dataGa:f["data-ga"]}:{},...f.dataGa?{dataGa:f.dataGa}:{},...f["data-track"]?{dataTrack:f["data-track"]}:{},...f.label?{label:f.label}:{}};"function"===typeof t&&t(e),b(n,!0)}),[a,b,g,u,f]),p=(0,n.useMemo)((()=>({...f,[a]:h})),[f,a,h]);return(0,r.jsx)(e,{...p})};var d=a(81691);const s=e=>t=>{let{payload:a={},...n}=t;const l=o(e);return(0,r.jsx)(l,{...n,callback:"onClick",payload:{...a,action:d.o1.buttonClicked}})}},33439:(e,t,a)=>{a.r(t),a.d(t,{Trust:()=>g,default:()=>h});a(98992),a(72577);var n=a(96540),l=a(86663),r=a(99275),o=a(72060),d=a(26363),s=a(55093),c=a(3203),i=a(3319),u=a(60908),f=a(74848);const b=(0,c.A)(r.Button),g=()=>{const[e,t]=(0,n.useMemo)((()=>{const{search:e}=window.location,{redirect_uri:t,agent_uri:a}=l.parse(e);return[(0,o.A)(t),a]})),[a,c]=(0,n.useState)(),[g,h,p]=(0,d.LC)(),[y,x]=(0,d.Yr)({},[g]),{sendLog:k,isReady:w}=(0,i.A)();return(0,n.useEffect)((()=>{let a=!0,n=null;const l=y.find((e=>e.url===t));return l?k({feature:"TrustUrl",description:"Redirect due to trusted url"}).finally((()=>{location.replace(`/api/v1/auth/account/origins/${l.id}/redirect?redirect_uri=${encodeURIComponent(e)}&agent_uri=${encodeURIComponent(t)}`)})):n=setTimeout((()=>{a&&c(!0)}),1e3),()=>{a=!1,n&&(clearTimeout(n),n=null)}}),[e,t,y,w]),a?(0,f.jsx)(u.Ay,{feature:"TrustUrl",children:(0,f.jsx)(r.Layer,{full:!0,children:(0,f.jsxs)(r.Flex,{"data-testid":"trust",alignItems:"center",justifyContent:"center",column:!0,width:"100%",height:"100%",background:"mainBackground",gap:4,children:[(0,f.jsx)(s.m,{animate:p}),(0,f.jsxs)(r.Text,{textAlign:"center",children:["Do you trust ",(0,f.jsx)(r.Text,{strong:!0,children:t}),"?"]}),(0,f.jsxs)(r.Flex,{column:!0,gap:2,alignItems:"center",children:[(0,f.jsx)(r.TextBig,{children:"Authorizing this URL will allow it to request your Netdata data."}),(0,f.jsxs)(r.Flex,{gap:2,children:[(0,f.jsx)(b,{flavour:"borderless",onClick:()=>window.location.replace(decodeURIComponent(e)),disabled:x||p,"data-ga":"url-authorization::click-cancel-button",feature:"TrustUrl",payload:{label:"Cancel"},children:"Cancel"}),(0,f.jsx)(b,{onClick:()=>h(t),disabled:x||p,isLoading:x||p,"data-ga":"url-authorization::click-yes-button",feature:"TrustUrl",payload:{label:"Yes"},children:"Yes"})]})]})]})})}):(0,f.jsx)(s.A,{})},h=g},72060:(t,a,n)=>{n.d(a,{A:()=>l});const l=t=>{try{if(!t)return null;const e=document.createElement("a");return e.href=t,/https?/.test(e.protocol)?new URL(e.protocol+"//"+e.host+e.pathname+e.search+e.hash).toString():null}catch(e){return null}}}}]);