"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7849],{24880:(T,v,e)=>{e.r(v),e.d(v,{SoloPanelPage:()=>g,SoloPanelRenderer:()=>d,default:()=>D});var o=e(74848),S=e(32196),i=e(96540),P=e(54148),m=e(40845),y=e(42418),h=e(62930),x=e(39419),j=e(7392),E=e(31678),R=e(72255),p=e(17388),C=e(30195),f=e(74730);function L(t,n){const[a,s]=(0,i.useState)(),[l,r]=(0,i.useState)();return(0,i.useEffect)(()=>{new p.g5().initSync(t);const F=t.activate();let c=null;try{c=(0,f.vL)(t,n)}catch{}return c?(M(c),s(c)):(0,f.SN)(n)?A(t,n).then(u=>{u?s(u):r("Panel not found")}):r("Panel not found"),F},[t,n]),[a,l]}function M(t){let n=t.parent;for(;n&&!n.isActive;)n.activate(),n=n.parent}function A(t,n){return new Promise(a=>{t.subscribeToEvent(C.d,()=>{const s=(0,f.vL)(t,n);s?a(s):t.state.body.activateRepeaters?.()}),t.state.body.activateRepeaters?.()})}function g({queryParams:t}){const n=(0,R.sP)(),{dashboard:a}=n.useState(),{uid:s="",type:l,slug:r}=(0,P.g)();return(0,i.useEffect)(()=>(n.loadDashboard({uid:s,type:l,slug:r,route:E.DashboardRoutes.Embedded}),()=>n.clearState()),[n,t,s,l,r]),t.panelId?a?(0,o.jsx)(d,{dashboard:a,panelId:t.panelId}):(0,o.jsx)(x.A,{}):(0,o.jsx)(j.L,{entity:"Panel"})}const D=g;function d({dashboard:t,panelId:n}){const[a,s]=L(t,n),l=(0,m.of)(N);return s?(0,o.jsx)(y.F,{title:s}):a?(0,o.jsx)("div",{className:l.container,children:(0,o.jsx)(a.Component,{model:a})}):(0,o.jsxs)("span",{children:["Loading ",(0,o.jsx)(h.y,{})]})}const N=t=>({container:(0,S.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=SoloPanelPage.e4d6f49edde408e65921.js.map