"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4492],{49286(y,P,t){t.r(P),t.d(P,{SoloPanel:()=>u,SoloPanelPage:()=>f,default:()=>W});var a=t(74848),I=t(22803),l=t(96540),v=t(71468),h=t(54148),C=t(70713),c=t(92745),T=t(34999),U=t(63142),A=t(27963),K=t(14580),L=t(42109);const x=e=>({dashboard:e.dashboard.getModel()}),B={initDashboard:L.v},R=(0,v.connect)(x,B),f=({route:e,queryParams:o,dashboard:n,initDashboard:i})=>{const[r,E]=(0,l.useState)(null),[_,d]=(0,l.useState)(!1),{keybindings:D}=(0,A.Il)(),{slug:g,uid:M,type:O}=(0,h.g)();(0,l.useEffect)(()=>{i({urlSlug:g,urlUid:M,urlType:O,routeName:e.routeName,fixUrl:!1,keybindingSrv:D})},[g,M,O,e.routeName,i,D]);const S=(0,l.useCallback)(()=>parseInt(o.panelId??"0",10),[o.panelId]);return(0,l.useEffect)(()=>{if(n){const s=n.getPanelByUrlId(o.panelId);if(!s){d(!0);return}s&&n.exitViewPanel(s),E(s),n.initViewPanel(s)}},[n,o.panelId]),(0,a.jsx)(u,{dashboard:n,notFound:_,panel:r,panelId:S(),timezone:o.timezone})},u=({dashboard:e,notFound:o,panel:n,panelId:i,timezone:r})=>{const E=(0,U.of)(m);return o?(0,a.jsx)(T.F,{severity:"error",title:(0,c.t)("dashboard.solo-panel.title-not-found","Panel with id {{panelId}} not found",{panelId:i})}):!n||!e?(0,a.jsx)("div",{children:(0,a.jsx)(c.x6,{i18nKey:"dashboard.solo-panel.loading-initializing-dashboard",children:"Loading & initializing dashboard"})}):(0,a.jsx)("div",{className:E.container,children:(0,a.jsx)(C.Ay,{children:({width:_,height:d})=>_===0?null:(0,a.jsx)(K.L,{stateKey:n.key,width:_,height:d,dashboard:e,panel:n,isEditing:!1,isViewing:!0,lazy:!1,timezone:r,hideMenu:!0})})})},W=R(f),m=e=>({container:(0,I.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=SoloPanelPageOld.2b2dc5ac204f699ace56.js.map